diff --git a/apps/dashboard/src/app/(auth)/login/page.client.tsx b/apps/dashboard/src/app/(auth)/login/page.client.tsx index 9f6d870e..d5ba9c65 100644 --- a/apps/dashboard/src/app/(auth)/login/page.client.tsx +++ b/apps/dashboard/src/app/(auth)/login/page.client.tsx @@ -1,11 +1,97 @@ 'use client'; -import { SignIn } from '@clerk/nextjs'; +import type { OAuthStrategy } from '@/types'; +import { useSignIn } from '@clerk/nextjs'; +import { toast } from 'sonner'; + +import EmailSignUp from './email-sign-in'; const PageClient = () => { + const { signIn } = useSignIn(); + + const signInWith = (strategy: OAuthStrategy) => { + if (!signIn) { + return toast.error('Sign in is not available at the moment'); + } + return signIn.authenticateWithRedirect({ + strategy, + redirectUrl: '/sso-callback', + redirectUrlComplete: '/', + }); + }; + return (
- +
+
Sign in
+
+ + +
+
+
+ or with email +
+
+ +

+ No account?{' '} + + Create one now + +

+
+
); }; diff --git a/apps/dashboard/src/app/(auth)/register/page.client.tsx b/apps/dashboard/src/app/(auth)/register/page.client.tsx index 38165d8a..6239db2e 100644 --- a/apps/dashboard/src/app/(auth)/register/page.client.tsx +++ b/apps/dashboard/src/app/(auth)/register/page.client.tsx @@ -1,11 +1,97 @@ 'use client'; -import { SignUp } from '@clerk/nextjs'; +import type { OAuthStrategy } from '@/types'; +import { useSignUp } from '@clerk/nextjs'; +import { toast } from 'sonner'; + +import EmailSignUp from './email-sign-up'; const PageClient = () => { + const { signUp } = useSignUp(); + + const signInWith = (strategy: OAuthStrategy) => { + if (!signUp) { + return toast.error('Sign in is not available at the moment'); + } + return signUp.authenticateWithRedirect({ + strategy, + redirectUrl: '/sso-callback', + redirectUrlComplete: '/', + }); + }; + return (
- +
+
Create an account
+
+ + +
+
+
+ or with email +
+
+ +

+ Already have an account?{' '} + + Sign in + +

+
+
); };