-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix Auth0 logout redirect #675
Conversation
$is_slo = (bool) $this->a0_options->get( 'singlelogout' ); | ||
$is_auto_login = (bool) $this->a0_options->get( 'auto_login' ); | ||
if ( ! WP_Auth0::ready() ) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if you call this when the SDK is not ready (I suppose) this call would return without an error? How can they know they need to wait and retry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ready
here is checking if the plugin is configured. If not, then we don't need to do anything during this process.
$this->assertContains( 'client_id=__test_client_id__', $logout_url_slo['query'] ); | ||
$this->assertContains( 'returnTo=' . rawurlencode( home_url() ), $logout_url_slo['query'] ); | ||
|
||
// Test that SSO has the same behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move to a different test, even if most of the conditions are shared 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm checking against the result of the previous method call, though.
/** | ||
* Test that a redirect to the homepage happens if ULP is turned on. | ||
*/ | ||
public function testThatRedirectHappensIfUlp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if ULP is turned on" but I only see you change a "auto-login" parameter. Is the naming correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. "Auto login" === ULP
Changes
Fix logout redirect if the plugin is not ready (no domain name or client ID)
Testing
Checklist