How to automatically login a user after they click a "verify email" link?
Unanswered
King Shepherd posted this in #help-forum
King ShepherdOP
The way I'm considering doing this is by having the email link go to an API endpoint that puts a session cookie in their cookie jar, and then just using
How do you implement this in next auth? The only way I know how to create a JWT / server session variable is with credentials:
which sends the credentials to
How can I sign them in and create a valid JWT just from them clicking the link?
redirect("/dashboard"). after they have a session.How do you implement this in next auth? The only way I know how to create a JWT / server session variable is with credentials:
signIn("credentials", {
email,
password,
callbackUrl: "/dashboard",
})which sends the credentials to
auth/[...nextauth]/route.ts How can I sign them in and create a valid JWT just from them clicking the link?