Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/strict-hornets-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
7 changes: 5 additions & 2 deletions packages/clerk-js/src/core/resources/SignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,11 @@ class SignInFuture implements SignInFutureResource {
throw new Error('Cannot finalize sign-in without a created session.');
}

// Reload the client to prevent an issue where the created session is not picked up.
await SignIn.clerk.client?.reload();
// Reload the client if the created session is not in the client's sessions. This can happen during modal SSO
// flows where the in-memory client does not have the created session.
if (SignIn.clerk.client && !SignIn.clerk.client.sessions.some(s => s.id === this.resource.createdSessionId)) {
await SignIn.clerk.client.reload();
}

await SignIn.clerk.setActive({ session: this.resource.createdSessionId, navigate });
});
Expand Down
Loading