Skip to content
Discussion options

You must be logged in to vote

Finally I've found the correct way! :D

Thanks @simonfarah !! It was just as you mentioned but where I call de signIn("email") method.

Documentation link

I had to add the "callbackUrl" property in the email signIn method:

const onSubmit = async (formData) => {
    // formData.preventDefault();

    const loginResult = await signIn("email", {
      // para que no redirija a otra pagina cuando da error el login:
      redirect: false,

      // para enviar al usuario a la URL deseada cuando se loguea por mail:
      callbackUrl: '/users/set-password',

      // le paso las credenciales al pedido (signIn):
      email: formData.email,
    });

    router.push("/api/auth/verify-request?provide…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Agrossio
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Agrossio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants