diff --git a/src/components/auth/signin.tsx b/src/components/auth/signin.tsx index a5bc47e0..8a68d90d 100644 --- a/src/components/auth/signin.tsx +++ b/src/components/auth/signin.tsx @@ -22,6 +22,7 @@ import { import { useToast } from '../ui/use-toast'; import { DemarcationLine, GoogleOauthButton } from './social-auth'; import { PasswordInput } from '../password-input'; +import { LoadingSpinner } from '../loading-spinner'; export const Signin = () => { const { toast } = useToast(); @@ -40,10 +41,11 @@ export const Signin = () => { const response = await signIn('signin', { ...data, redirect: false }); if (!response?.ok) { const errorMessage = - response?.error?.includes('User') && response?.error?.includes('does not exist') + response?.error?.includes('User') && + response?.error?.includes('does not exist') ? 'User does not exist' : response?.error || 'Internal server error'; - + return toast({ title: errorMessage, variant: 'destructive', @@ -53,7 +55,7 @@ export const Signin = () => { title: 'Login successful! Welcome back!', variant: 'success', }); - + const searchParams = new URLSearchParams(window.location.search); const redirect = searchParams.get('next') || APP_PATHS.HOME; router.push(redirect); @@ -65,7 +67,7 @@ export const Signin = () => { }); } } - + return (