From 5652ce1098e52b1e8d0a3b722caf17ecbe5e3444 Mon Sep 17 00:00:00 2001 From: DanielS Date: Thu, 25 Jun 2026 00:30:20 +0200 Subject: [PATCH] fix: replace localhost in reset link with staging domain --- shop/lib/actions/users.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shop/lib/actions/users.ts b/shop/lib/actions/users.ts index e7a367a..0273ddf 100644 --- a/shop/lib/actions/users.ts +++ b/shop/lib/actions/users.ts @@ -85,8 +85,10 @@ export async function resetPassword(email: string) { }); if (error) throw error; 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'); + // 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({ to: email, subject: 'Passwort zurücksetzen',