fix: resolve invitation link expiration by adding verification landing page
All checks were successful
Staging Build / build (push) Successful in 3m35s
All checks were successful
Staging Build / build (push) Successful in 3m35s
This commit is contained in:
@@ -84,7 +84,7 @@ export async function createUser(data: { email: string; role?: 'admin' | 'partne
|
||||
const tokenHash = (linkData as any)?.properties?.hashed_token;
|
||||
if (tokenHash) {
|
||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de';
|
||||
const setupLink = `${siteUrl}/auth/confirm?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`;
|
||||
const setupLink = `${siteUrl}/auth/verify-link?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`;
|
||||
await sendMail({
|
||||
to: data.email,
|
||||
subject: 'Willkommen bei CASPOS Shop – Ihr Benutzerkonto wurde erstellt',
|
||||
@@ -183,7 +183,7 @@ export async function resetPassword(email: string) {
|
||||
if (!tokenHash) throw new Error('Recovery token not generated');
|
||||
// Build link pointing to our own /auth/confirm route
|
||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de';
|
||||
const resetLink = `${siteUrl}/auth/confirm?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`;
|
||||
const resetLink = `${siteUrl}/auth/verify-link?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`;
|
||||
await sendMail({
|
||||
to: email,
|
||||
subject: 'Passwort zurücksetzen',
|
||||
|
||||
Reference in New Issue
Block a user