After a user submits their email to next-auth, how to pass it to the check email page?

question with next-auth email provider. After a user submits their email, they get sent to the check-email page.... How can I pass that email address through to the check email page?
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
fotoflo
fotofloOP2y ago
thanks @lee Hi Lee, trying
<form
method="post"
action="/api/auth/signin/[email protected]"
className={formClassName}
>
<form
method="post"
action="/api/auth/signin/[email protected]"
className={formClassName}
>
Not working @lee the querystring isnt coming through
const handleLogin = (email: "[email protected]") => {
signIn("email", {
email,
callbackUrl: `/api/auth/signin/email?passthru=${email}`,
});
};
const handleLogin = (email: "[email protected]") => {
signIn("email", {
email,
callbackUrl: `/api/auth/signin/email?passthru=${email}`,
});
};
sends the user here: http://localhost:3000/api/auth/signin?error=EmailSignin
const router = useRouter();

const handleLogin = (email: "[email protected]") => {
router.push(
`/api/auth/signin/email?email=${email}&passthru=${email}&csrfToken=${csrfToken}&callbackUrl=/dashboard`
);
};
const router = useRouter();

const handleLogin = (email: "[email protected]") => {
router.push(
`/api/auth/signin/email?email=${email}&passthru=${email}&csrfToken=${csrfToken}&callbackUrl=/dashboard`
);
};
also doesn't work w000 i resolved it
const router = useRouter();

const handleLogin = async (e) => {
e.preventDefault();

const result = await signIn("email", {
redirect: false,
});
router.push("/info/check-email?test=true");
};
const router = useRouter();

const handleLogin = async (e) => {
e.preventDefault();

const result = await signIn("email", {
redirect: false,
});
router.push("/info/check-email?test=true");
};
without any validation or anything...
Want results from more Discord servers?
Add your server