File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ final class Authentication extends Base
4141
4242 'login_form_logout ' => 'onLogout ' ,
4343 'auth0_logout ' => 'onLogout ' ,
44+ 'auth0_token_exchange_failed ' => 'onExchangeFailed ' ,
4445
4546 'before_signup_header ' => 'onRegistration ' ,
4647
@@ -495,8 +496,8 @@ public function onLogin(): void
495496 } catch (Throwable ) {
496497 }
497498
498- wp_redirect ( ' / ' );
499- exit ;
499+ do_action ( ' auth0_token_exchange_failed ' , $ throwable );
500+ return ;
500501 }
501502
502503 $ session = $ this ->getSdk ()
@@ -549,6 +550,13 @@ public function onLogin(): void
549550 exit ;
550551 }
551552
553+ public function onExchangeFailed (Throwable $ _ )
554+ {
555+ // Custom hook ('auth0_token_exchange_failed') to register when token exchange fails.
556+ wp_redirect ('/ ' );
557+ exit ;
558+ }
559+
552560 public function onLogout (): never
553561 {
554562 wp_logout ();
You can’t perform that action at this time.
0 commit comments