File tree Expand file tree Collapse file tree 4 files changed +23
-8
lines changed
testing/src/playwright/unstable/page-objects Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
{ "path" : " ./dist/clerk.js" , "maxSize" : " 612kB" },
4
4
{ "path" : " ./dist/clerk.browser.js" , "maxSize" : " 72.2KB" },
5
5
{ "path" : " ./dist/clerk.legacy.browser.js" , "maxSize" : " 115KB" },
6
- { "path" : " ./dist/clerk.headless*.js" , "maxSize" : " 53.06KB " },
7
- { "path" : " ./dist/ui-common*.js" , "maxSize" : " 108.75KB " },
6
+ { "path" : " ./dist/clerk.headless*.js" , "maxSize" : " 55KB " },
7
+ { "path" : " ./dist/ui-common*.js" , "maxSize" : " 108.56KB " },
8
8
{ "path" : " ./dist/vendors*.js" , "maxSize" : " 40.2KB" },
9
9
{ "path" : " ./dist/coinbase*.js" , "maxSize" : " 38KB" },
10
10
{ "path" : " ./dist/createorganization*.js" , "maxSize" : " 5KB" },
Original file line number Diff line number Diff line change @@ -1283,7 +1283,16 @@ export class Clerk implements ClerkInterface {
1283
1283
} ;
1284
1284
1285
1285
public __experimental_navigateToTask = async ( { redirectUrlComplete } : NextTaskParams = { } ) : Promise < void > => {
1286
- const session = await this . session ?. reload ( ) ;
1286
+ /**
1287
+ * Invalidate previously cache pages with auth state before navigating
1288
+ */
1289
+ const onBeforeSetActive : SetActiveHook =
1290
+ typeof window !== 'undefined' && typeof window . __unstable__onBeforeSetActive === 'function'
1291
+ ? window . __unstable__onBeforeSetActive
1292
+ : noop ;
1293
+ await onBeforeSetActive ( ) ;
1294
+
1295
+ const session = this . session ;
1287
1296
if ( ! session || ! this . environment ) {
1288
1297
return ;
1289
1298
}
@@ -1311,6 +1320,17 @@ export class Clerk implements ClerkInterface {
1311
1320
1312
1321
this . #setAccessors( session ) ;
1313
1322
this . #emit( ) ;
1323
+
1324
+ /**
1325
+ * Invoke the Next.js middleware to synchronize server and client state after resolving a session task.
1326
+ * This ensures that any server-side logic depending on the session status (like middleware-based
1327
+ * redirects or protected routes) correctly reflects the updated client authentication state.
1328
+ */
1329
+ const onAfterSetActive : SetActiveHook =
1330
+ typeof window !== 'undefined' && typeof window . __unstable__onAfterSetActive === 'function'
1331
+ ? window . __unstable__onAfterSetActive
1332
+ : noop ;
1333
+ await onAfterSetActive ( ) ;
1314
1334
} ;
1315
1335
1316
1336
public addListener = ( listener : ListenerCallback ) : UnsubscribeCallback => {
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ export const createSessionTaskComponentPageObject = (testArgs: { page: EnhancedP
12
12
const createOrganizationButton = page . getByRole ( 'button' , { name : / c r e a t e o r g a n i z a t i o n / i } ) ;
13
13
14
14
await expect ( createOrganizationButton ) . toBeVisible ( ) ;
15
- expect ( page . url ( ) ) . toContain ( 'add-organization' ) ;
16
15
17
16
await page . locator ( 'input[name=name]' ) . fill ( fakeOrganization . name ) ;
18
17
await page . locator ( 'input[name=slug]' ) . fill ( fakeOrganization . slug ) ;
You can’t perform that action at this time.
0 commit comments