use sign up instead of sign in
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useSignIn } from '@clerk/nextjs';
|
import { useSignUp } from '@clerk/nextjs';
|
||||||
import type { OAuthStrategy } from '@clerk/nextjs/dist/types/server';
|
import type { OAuthStrategy } from '@clerk/nextjs/dist/types/server';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
import EmailSignUp from './email-sign-up';
|
import EmailSignUp from './email-sign-up';
|
||||||
|
|
||||||
const PageClient = () => {
|
const PageClient = () => {
|
||||||
const { signIn } = useSignIn();
|
const { signUp } = useSignUp();
|
||||||
|
|
||||||
const signInWith = (strategy: OAuthStrategy) => {
|
const signInWith = (strategy: OAuthStrategy) => {
|
||||||
if (!signIn) {
|
if (!signUp) {
|
||||||
return toast.error('Sign in is not available at the moment');
|
return toast.error('Sign in is not available at the moment');
|
||||||
}
|
}
|
||||||
return signIn.authenticateWithRedirect({
|
return signUp.authenticateWithRedirect({
|
||||||
strategy,
|
strategy,
|
||||||
redirectUrl: '/sso-callback',
|
redirectUrl: '/sso-callback',
|
||||||
redirectUrlComplete: '/',
|
redirectUrlComplete: '/',
|
||||||
|
|||||||
Reference in New Issue
Block a user