Skip to content

Commit 53bd34f

Browse files
alexcarpenterjacekradkodstaleypanteliselefLekoArts
authored
feat(clerk-js): Launch sign-in-or-up flow (#4788)
Co-authored-by: Jacek <jacek@clerk.dev> Co-authored-by: Dylan Staley <88163+dstaley@users.noreply.github.com> Co-authored-by: panteliselef <panteliselef@outlook.com> Co-authored-by: Lennart <lekoarts@gmail.com> Co-authored-by: Bryce Kalow <bryce@clerk.dev>
1 parent 4af3538 commit 53bd34f

File tree

30 files changed

+657
-441
lines changed

30 files changed

+657
-441
lines changed

.changeset/tough-bugs-vanish.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@clerk/clerk-js': minor
3+
'@clerk/clerk-react': minor
4+
'@clerk/types': minor
5+
'@clerk/vue': minor
6+
---
7+
8+
Introduce sign-in-or-up flow.

integration/presets/envs.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ const withWaitlistdMode = withEmailCodes
113113
.setEnvVariable('private', 'CLERK_SECRET_KEY', instanceKeys.get('with-waitlist-mode').sk)
114114
.setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', instanceKeys.get('with-waitlist-mode').pk);
115115

116-
const withCombinedFlow = withEmailCodes
116+
const withSignInOrUpFlow = withEmailCodes
117117
.clone()
118-
.setId('withCombinedFlow')
119-
.setEnvVariable('private', 'CLERK_SECRET_KEY', instanceKeys.get('with-email-codes').sk)
120-
.setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', instanceKeys.get('with-email-codes').pk)
121-
.setEnvVariable('public', 'EXPERIMENTAL_COMBINED_FLOW', 'true')
122-
.setEnvVariable('public', 'CLERK_SIGN_IN_URL', '/sign-in')
123-
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', '/sign-in');
118+
.setId('withSignInOrUpFlow')
119+
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', undefined);
120+
121+
const withSignInOrUpEmailLinksFlow = withEmailLinks
122+
.clone()
123+
.setId('withSignInOrUpEmailLinksFlow')
124+
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', undefined);
124125

125126
export const envs = {
126127
base,
@@ -138,5 +139,6 @@ export const envs = {
138139
withRestrictedMode,
139140
withLegalConsent,
140141
withWaitlistdMode,
141-
withCombinedFlow,
142+
withSignInOrUpFlow,
143+
withSignInOrUpEmailLinksFlow,
142144
} as const;

integration/presets/longRunningApps.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export const createLongRunningApps = () => {
3131
},
3232
{ id: 'next.appRouter.withCustomRoles', config: next.appRouter, env: envs.withCustomRoles },
3333
{ id: 'next.appRouter.withReverification', config: next.appRouter, env: envs.withReverification },
34-
{ id: 'next.appRouter.withCombinedFlow', config: next.appRouter, env: envs.withCombinedFlow },
34+
{ id: 'next.appRouter.withSignInOrUpFlow', config: next.appRouter, env: envs.withSignInOrUpFlow },
35+
{
36+
id: 'next.appRouter.withSignInOrUpEmailLinksFlow',
37+
config: next.appRouter,
38+
env: envs.withSignInOrUpEmailLinksFlow,
39+
},
3540
{ id: 'quickstart.next.appRouter', config: next.appRouterQuickstart, env: envs.withEmailCodesQuickstart },
3641
{ id: 'elements.next.appRouter', config: elements.nextAppRouter, env: envs.withEmailCodes },
3742
{ id: 'astro.node.withCustomRoles', config: astro.node, env: envs.withCustomRoles },

integration/templates/next-app-router/src/app/layout.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
1313
return (
1414
<ClerkProvider
1515
experimental={{
16-
combinedFlow: process.env.NEXT_PUBLIC_EXPERIMENTAL_COMBINED_FLOW
17-
? process.env.NEXT_PUBLIC_EXPERIMENTAL_COMBINED_FLOW === 'true'
18-
: undefined,
1916
persistClient: process.env.NEXT_PUBLIC_EXPERIMENTAL_PERSIST_CLIENT
2017
? process.env.NEXT_PUBLIC_EXPERIMENTAL_PERSIST_CLIENT === 'true'
2118
: undefined,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { SignIn } from '@clerk/nextjs';
2+
3+
export default function Page() {
4+
return (
5+
<div>
6+
<SignIn
7+
routing={'path'}
8+
path={'/sign-in'}
9+
signUpUrl={'/sign-up'}
10+
fallback={<>Loading sign in</>}
11+
withSignUp
12+
/>
13+
</div>
14+
);
15+
}

integration/templates/next-app-router/src/app/sign-in/[[...catchall]]/page.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ export default function Page() {
88
path={'/sign-in'}
99
signUpUrl={'/sign-up'}
1010
fallback={<>Loading sign in</>}
11-
__experimental={{
12-
combinedProps: {},
13-
}}
1411
/>
1512
</div>
1613
);

integration/tests/combined-sign-in-flow.test.ts

Lines changed: 0 additions & 160 deletions
This file was deleted.

integration/tests/combined-sign-up-flow.test.ts

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)