added select form
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { signIn } from 'next-auth/react';
|
||||
import Link from 'next/link';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { redirect, useSearchParams } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { Toaster, toast } from 'react-hot-toast';
|
||||
@@ -29,10 +29,10 @@ export const Login = () => {
|
||||
setIsLoading(true);
|
||||
const data = await signIn('credentials', {
|
||||
redirect: false,
|
||||
callbackUrl: searchParams.get('redirect') || '/',
|
||||
email: form.getValues('email'),
|
||||
password: form.getValues('password'),
|
||||
});
|
||||
setIsLoading(false);
|
||||
if (!data || data.error) {
|
||||
toast.error('E-Mail / Passwort ist falsch!', {
|
||||
style: {
|
||||
@@ -42,8 +42,9 @@ export const Login = () => {
|
||||
'var(--fallback-nc, oklch(var(--nc) / var(--tw-text-opacity, 1)))',
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
setIsLoading(false);
|
||||
redirect(searchParams.get('redirect') || '/');
|
||||
})}
|
||||
>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user