Skip to content

Commit d74efe3

Browse files
committed
Add changeset
1 parent 231ad5d commit d74efe3

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.changeset/tiny-planes-lead.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/backend': patch
3+
'@clerk/nextjs': patch
4+
'@clerk/types': patch
5+
---
6+
7+
Redirect to tasks on `auth.protect()`

integration/tests/session-tasks-sign-in.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
3838
await u.po.signIn.continue();
3939
await u.po.expect.toBeSignedIn();
4040

41-
// Gets redirected back to tasks when accessing protected route by `auth.protect`
41+
// Redirects back to tasks when accessing protected route by `auth.protect`
4242
await u.page.goToRelative('/page-protected');
4343
expect(page.url()).toContain('tasks');
4444

integration/tests/session-tasks-sign-up.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
3939
password: fakeUser.password,
4040
});
4141

42-
// Gets redirected back to tasks when accessing protected route by `auth.protect`
42+
// Redirects back to tasks when accessing protected route by `auth.protect`
4343
await u.page.goToRelative('/page-protected');
4444
expect(page.url()).toContain('tasks');
4545

packages/backend/src/createRedirect.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ export const createRedirect: CreateRedirect = params => {
108108
errorThrower.throwMissingPublishableKeyError();
109109
}
110110
const rootTasksPath = 'tasks';
111-
const signInUrlWithTasks = signInUrl
112-
? `${signInUrl}/${rootTasksPath}`
113-
: `${accountsBaseUrl}/sign-in/${rootTasksPath}`;
114-
return redirectAdapter(buildUrl(baseUrl, signInUrlWithTasks, null, isDevelopment ? params.devBrowserToken : null));
111+
const tasksUrl = signInUrl ? `${signInUrl}/${rootTasksPath}` : `${accountsBaseUrl}/sign-in/${rootTasksPath}`;
112+
return redirectAdapter(buildUrl(baseUrl, tasksUrl, null, isDevelopment ? params.devBrowserToken : null));
115113
};
116114

117115
return { redirectToSignUp, redirectToSignIn, redirectToTasks };

0 commit comments

Comments
 (0)