fedeya / next-auth-sanity

NextAuth Adapter and Provider for Sanity
https://sanity.io/plugins/next-auth-sanity
MIT License
76 stars 21 forks source link

Throw error #43

Closed axelverglas closed 1 year ago

axelverglas commented 1 year ago

I can't show errors on my signUp page please help me const onSubmit: SubmitHandler = async data => { const { email, password, name } = data;

try {
  const user = await signUp({
    email,
    password,
    name,
  });
  console.log(user);

  const res = await signIn('sanity-login', {
    redirect: false,
    email,
    password,
  });

  if (res?.error) {
    console.log(res);
    toast.error(res.error);
    return;
  }

  router.push('/');
} catch (error) {
  console.log(error);

  toast.error('Something went wrong. Please try again later.');
}

};

fedeya commented 1 year ago

Hi @axelverglas! now in the latest version the lib throw errors, this should be fixed