fix: replace localhost in reset link with staging domain
All checks were successful
Staging Build / build (push) Successful in 2m46s

This commit is contained in:
DanielS
2026-06-25 00:30:20 +02:00
parent cebf677758
commit 5652ce1098

View File

@@ -85,8 +85,10 @@ export async function resetPassword(email: string) {
}); });
if (error) throw error; if (error) throw error;
const linkData = data as any; const linkData = data as any;
const resetLink = linkData?.properties?.action_link || linkData?.action_link || linkData?.link || ''; let resetLink = linkData?.properties?.action_link || linkData?.action_link || linkData?.link || '';
if (!resetLink) throw new Error('Reset link not generated'); if (!resetLink) throw new Error('Reset link not generated');
// Fix: replace localhost URLs with actual site URL
resetLink = resetLink.replace(/http:\/\/localhost:\d+/g, process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de');
await sendMail({ await sendMail({
to: email, to: email,
subject: 'Passwort zurücksetzen', subject: 'Passwort zurücksetzen',