File tree Expand file tree Collapse file tree 6 files changed +22
-6
lines changed Expand file tree Collapse file tree 6 files changed +22
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @clerk/clerk-js ' : patch
3
+ ' @clerk/clerk-react ' : patch
4
+ ' @clerk/types ' : patch
5
+ ---
6
+
7
+ Introduce ` __internal_hasAfterAuthFlows ` flag
Original file line number Diff line number Diff line change @@ -2524,6 +2524,10 @@ export class Clerk implements ClerkInterface {
2524
2524
this . #emit( ) ;
2525
2525
} ;
2526
2526
2527
+ get __internal_hasAfterAuthFlows ( ) {
2528
+ return ! ! this . environment ?. organizationSettings ?. forceOrganizationSelection ;
2529
+ }
2530
+
2527
2531
#defaultSession = ( client : ClientResource ) : SignedInSessionResource | null => {
2528
2532
if ( client . lastActiveSessionId ) {
2529
2533
const currentSession = client . signedInSessions . find ( s => s . id === client . lastActiveSessionId ) ;
Original file line number Diff line number Diff line change @@ -235,11 +235,10 @@ export class SignIn extends BaseResource implements SignInResource {
235
235
236
236
const redirectUrlWithAuthToken = SignIn . clerk . buildUrlWithAuth ( redirectUrl ) ;
237
237
238
- // When force organization selection is enabled, redirect to SSO callback route.
238
+ // When after-auth is enabled, redirect to SSO callback route.
239
239
// This ensures organization selection tasks are displayed after sign-in,
240
240
// rather than redirecting to potentially unprotected pages while the session is pending.
241
- const actionCompleteRedirectUrl = SignIn . clerk . __unstable__environment ?. organizationSettings
242
- . forceOrganizationSelection
241
+ const actionCompleteRedirectUrl = SignIn . clerk . __internal_hasAfterAuthFlows
243
242
? redirectUrlWithAuthToken
244
243
: redirectUrlComplete ;
245
244
Original file line number Diff line number Diff line change @@ -290,11 +290,10 @@ export class SignUp extends BaseResource implements SignUpResource {
290
290
291
291
const redirectUrlWithAuthToken = SignUp . clerk . buildUrlWithAuth ( redirectUrl ) ;
292
292
293
- // When force organization selection is enabled, redirect to SSO callback route.
293
+ // When force after-auth is enabled, redirect to SSO callback route.
294
294
// This ensures organization selection tasks are displayed after sign-up,
295
295
// rather than redirecting to potentially unprotected pages while the session is pending.
296
- const actionCompleteRedirectUrl = SignUp . clerk . __unstable__environment ?. organizationSettings
297
- . forceOrganizationSelection
296
+ const actionCompleteRedirectUrl = SignUp . clerk . __internal_hasAfterAuthFlows
298
297
? redirectUrlWithAuthToken
299
298
: redirectUrlComplete ;
300
299
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ type IsomorphicLoadedClerk = Without<
105
105
| 'apiKeys'
106
106
| '__internal_setComponentNavigationContext'
107
107
| '__internal_setActiveInProgress'
108
+ | '__internal_hasAfterAuthFlows'
108
109
> & {
109
110
client : ClientResource | undefined ;
110
111
billing : CommerceBillingNamespace | undefined ;
Original file line number Diff line number Diff line change @@ -841,6 +841,12 @@ export interface Clerk {
841
841
*/
842
842
__internal_setActiveInProgress : boolean ;
843
843
844
+ /**
845
+ * Internal flag indicating whether after-auth flows are enabled based on instance settings.
846
+ * @internal
847
+ */
848
+ __internal_hasAfterAuthFlows : boolean ;
849
+
844
850
/**
845
851
* API Keys Object
846
852
* @experimental
You can’t perform that action at this time.
0 commit comments