debug(web): add logging to changePasswordAction to diagnose Verbindungsfehler
Tessera CI/CD / Lint & Type Check (push) Successful in 42s
Tessera CI/CD / Tests (push) Successful in 36s
Tessera CI/CD / Build & Publish Images (push) Successful in 1m22s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 16:38:48 +02:00
parent a8cd528f5a
commit c8210a2abc
+8 -1
View File
@@ -106,7 +106,10 @@ export async function changePasswordAction(
const cookieStore = await cookies();
const session = cookieStore.get('session')?.value;
console.log('[changePasswordAction] session present:', !!session, 'API_URL:', API_URL);
if (!session) {
console.error('[changePasswordAction] no session cookie found');
return { success: false, error: 'networkError' };
}
@@ -120,8 +123,11 @@ export async function changePasswordAction(
body: JSON.stringify({ currentPassword, newPassword }),
});
console.log('[changePasswordAction] API response status:', response.status);
if (!response.ok) {
const data = await response.json().catch(() => null);
console.error('[changePasswordAction] API error:', data);
if (data?.message === 'Current password is incorrect') {
return { success: false, error: 'wrongCurrentPassword' };
}
@@ -129,7 +135,8 @@ export async function changePasswordAction(
}
return { success: true };
} catch {
} catch (err) {
console.error('[changePasswordAction] fetch threw:', err);
return { success: false, error: 'networkError' };
}
}