Skip to content

Commit

Permalink
feat(clerk-js): Launch sign-in-or-up flow (#4788)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
6 people authored Jan 16, 2025
1 parent 4af3538 commit 53bd34f
Show file tree
Hide file tree
Showing 30 changed files with 657 additions and 441 deletions.
8 changes: 8 additions & 0 deletions .changeset/tough-bugs-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@clerk/clerk-js': minor
'@clerk/clerk-react': minor
'@clerk/types': minor
'@clerk/vue': minor
---

Introduce sign-in-or-up flow.
18 changes: 10 additions & 8 deletions integration/presets/envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ const withWaitlistdMode = withEmailCodes
.setEnvVariable('private', 'CLERK_SECRET_KEY', instanceKeys.get('with-waitlist-mode').sk)
.setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', instanceKeys.get('with-waitlist-mode').pk);

const withCombinedFlow = withEmailCodes
const withSignInOrUpFlow = withEmailCodes
.clone()
.setId('withCombinedFlow')
.setEnvVariable('private', 'CLERK_SECRET_KEY', instanceKeys.get('with-email-codes').sk)
.setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', instanceKeys.get('with-email-codes').pk)
.setEnvVariable('public', 'EXPERIMENTAL_COMBINED_FLOW', 'true')
.setEnvVariable('public', 'CLERK_SIGN_IN_URL', '/sign-in')
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', '/sign-in');
.setId('withSignInOrUpFlow')
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', undefined);

const withSignInOrUpEmailLinksFlow = withEmailLinks
.clone()
.setId('withSignInOrUpEmailLinksFlow')
.setEnvVariable('public', 'CLERK_SIGN_UP_URL', undefined);

export const envs = {
base,
Expand All @@ -138,5 +139,6 @@ export const envs = {
withRestrictedMode,
withLegalConsent,
withWaitlistdMode,
withCombinedFlow,
withSignInOrUpFlow,
withSignInOrUpEmailLinksFlow,
} as const;
7 changes: 6 additions & 1 deletion integration/presets/longRunningApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export const createLongRunningApps = () => {
},
{ id: 'next.appRouter.withCustomRoles', config: next.appRouter, env: envs.withCustomRoles },
{ id: 'next.appRouter.withReverification', config: next.appRouter, env: envs.withReverification },
{ id: 'next.appRouter.withCombinedFlow', config: next.appRouter, env: envs.withCombinedFlow },
{ id: 'next.appRouter.withSignInOrUpFlow', config: next.appRouter, env: envs.withSignInOrUpFlow },
{
id: 'next.appRouter.withSignInOrUpEmailLinksFlow',
config: next.appRouter,
env: envs.withSignInOrUpEmailLinksFlow,
},
{ id: 'quickstart.next.appRouter', config: next.appRouterQuickstart, env: envs.withEmailCodesQuickstart },
{ id: 'elements.next.appRouter', config: elements.nextAppRouter, env: envs.withEmailCodes },
{ id: 'astro.node.withCustomRoles', config: astro.node, env: envs.withCustomRoles },
Expand Down
3 changes: 0 additions & 3 deletions integration/templates/next-app-router/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
<ClerkProvider
experimental={{
combinedFlow: process.env.NEXT_PUBLIC_EXPERIMENTAL_COMBINED_FLOW
? process.env.NEXT_PUBLIC_EXPERIMENTAL_COMBINED_FLOW === 'true'
: undefined,
persistClient: process.env.NEXT_PUBLIC_EXPERIMENTAL_PERSIST_CLIENT
? process.env.NEXT_PUBLIC_EXPERIMENTAL_PERSIST_CLIENT === 'true'
: undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { SignIn } from '@clerk/nextjs';

export default function Page() {
return (
<div>
<SignIn
routing={'path'}
path={'/sign-in'}
signUpUrl={'/sign-up'}
fallback={<>Loading sign in</>}
withSignUp
/>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ export default function Page() {
path={'/sign-in'}
signUpUrl={'/sign-up'}
fallback={<>Loading sign in</>}
__experimental={{
combinedProps: {},
}}
/>
</div>
);
Expand Down
160 changes: 0 additions & 160 deletions integration/tests/combined-sign-in-flow.test.ts

This file was deleted.

122 changes: 0 additions & 122 deletions integration/tests/combined-sign-up-flow.test.ts

This file was deleted.

Loading

0 comments on commit 53bd34f

Please sign in to comment.