File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
packages/clerk-js/src/core Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/clerk-js ' : patch
3+ ---
4+
5+ Prevent infinite loop when the client is blocked
Original file line number Diff line number Diff line change @@ -1493,15 +1493,24 @@ export class Clerk implements ClerkInterface {
14931493 if ( ! this . client || ! this . session ) {
14941494 return ;
14951495 }
1496- const newClient = await Client . getOrCreateInstance ( ) . fetch ( ) ;
1497- this . updateClient ( newClient ) ;
1498- if ( this . session ) {
1499- return ;
1500- }
1501- if ( opts . broadcast ) {
1502- this . #broadcastSignOutEvent( ) ;
1496+ try {
1497+ const newClient = await Client . getOrCreateInstance ( ) . fetch ( ) ;
1498+ this . updateClient ( newClient ) ;
1499+ if ( this . session ) {
1500+ return ;
1501+ }
1502+ if ( opts . broadcast ) {
1503+ this . #broadcastSignOutEvent( ) ;
1504+ }
1505+ return this . setActive ( { session : null } ) ;
1506+ } catch ( err ) {
1507+ // Handle the 403 Forbidden
1508+ if ( err . status === 403 ) {
1509+ return this . setActive ( { session : null } ) ;
1510+ } else {
1511+ throw err ;
1512+ }
15031513 }
1504- return this . setActive ( { session : null } ) ;
15051514 } ;
15061515
15071516 public authenticateWithGoogleOneTap = async (
You can’t perform that action at this time.
0 commit comments