auth: show email verified banner on login page after verification
- Append ?verified=true to callbackURL in verification link - Login page reads query param and shows green success banner when user lands after email verification
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { BASE_URL } from '$env/static/private';
|
||||
import { BETTER_AUTH_URL } from '$env/static/private';
|
||||
import { sendMail } from './resend';
|
||||
|
||||
export async function sendVerificationEmail(options: {
|
||||
email: string;
|
||||
token: string;
|
||||
}) {
|
||||
const verificationUrl = `${BASE_URL}/api/auth/verify-email?token=${options.token}&callbackURL=/login`;
|
||||
const verificationUrl = `${BETTER_AUTH_URL}/api/auth/verify-email?token=${options.token}&callbackURL=/login?verified=true`;
|
||||
|
||||
await sendMail({
|
||||
to: options.email,
|
||||
|
||||
Reference in New Issue
Block a user