File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/clerk-js/src/core/resources Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ---
Original file line number Diff line number Diff line change @@ -1117,8 +1117,11 @@ class SignInFuture implements SignInFutureResource {
11171117 throw new Error ( 'Cannot finalize sign-in without a created session.' ) ;
11181118 }
11191119
1120- // Reload the client to prevent an issue where the created session is not picked up.
1121- await SignIn . clerk . client ?. reload ( ) ;
1120+ // Reload the client if the created session is not in the client's sessions. This can happen during modal SSO
1121+ // flows where the in-memory client does not have the created session.
1122+ if ( SignIn . clerk . client && ! SignIn . clerk . client . sessions . some ( s => s . id === this . resource . createdSessionId ) ) {
1123+ await SignIn . clerk . client . reload ( ) ;
1124+ }
11221125
11231126 await SignIn . clerk . setActive ( { session : this . resource . createdSessionId , navigate } ) ;
11241127 } ) ;
You can’t perform that action at this time.
0 commit comments