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',