Skip to content

Commit 6876563

Browse files
authored
fix(clerk-js): Remove cache revalidation hooks from pending session handling (#6389)
1 parent 0371fbd commit 6876563

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.changeset/full-impalas-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Remove cache revalidation hooks from pending session handling. This fixes unmounting issues from `SignIn` and `SignUp` AIOs during after-auth flows.

packages/clerk-js/src/core/clerk.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,17 +1225,16 @@ export class Clerk implements ClerkInterface {
12251225
}
12261226
}
12271227

1228-
/**
1229-
* Hint to each framework, that the user will be signed out when `{session: null}` is provided.
1230-
*/
1231-
await onBeforeSetActive(newSession === null ? 'sign-out' : undefined);
1232-
12331228
if (newSession?.status === 'pending') {
12341229
await this.#handlePendingSession(newSession);
1235-
await onAfterSetActive();
12361230
return;
12371231
}
12381232

1233+
/**
1234+
* Hint to each framework, that the user will be signed out when `{session: null}` is provided.
1235+
*/
1236+
await onBeforeSetActive(newSession === null ? 'sign-out' : undefined);
1237+
12391238
//1. setLastActiveSession to passed user session (add a param).
12401239
// Note that this will also update the session's active organization
12411240
// id.

0 commit comments

Comments
 (0)