File tree 1 file changed +10
-2
lines changed
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
41
41
42
42
'login_form_logout ' => 'onLogout ' ,
43
43
'auth0_logout ' => 'onLogout ' ,
44
+ 'auth0_token_exchange_failed ' => 'onExchangeFailed ' ,
44
45
45
46
'before_signup_header ' => 'onRegistration ' ,
46
47
@@ -495,8 +496,8 @@ public function onLogin(): void
495
496
} catch (Throwable ) {
496
497
}
497
498
498
- wp_redirect ( ' / ' );
499
- exit ;
499
+ do_action ( ' auth0_token_exchange_failed ' , $ throwable );
500
+ return ;
500
501
}
501
502
502
503
$ session = $ this ->getSdk ()
@@ -549,6 +550,13 @@ public function onLogin(): void
549
550
exit ;
550
551
}
551
552
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
+
552
560
public function onLogout (): never
553
561
{
554
562
wp_logout ();
You can’t perform that action at this time.
0 commit comments