diff --git a/.changeset/full-impalas-wonder.md b/.changeset/full-impalas-wonder.md new file mode 100644 index 00000000000..c001ba75538 --- /dev/null +++ b/.changeset/full-impalas-wonder.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Remove cache revalidation hooks from pending session handling. This fixes unmounting issues from `SignIn` and `SignUp` AIOs during after-auth flows. diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index ca3b55ae716..5d1de0e53ee 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -1225,17 +1225,16 @@ export class Clerk implements ClerkInterface { } } - /** - * Hint to each framework, that the user will be signed out when `{session: null}` is provided. - */ - await onBeforeSetActive(newSession === null ? 'sign-out' : undefined); - if (newSession?.status === 'pending') { await this.#handlePendingSession(newSession); - await onAfterSetActive(); return; } + /** + * Hint to each framework, that the user will be signed out when `{session: null}` is provided. + */ + await onBeforeSetActive(newSession === null ? 'sign-out' : undefined); + //1. setLastActiveSession to passed user session (add a param). // Note that this will also update the session's active organization // id.