fix: set refresh token (not access token) in HttpOnly cookie

The login endpoint was incorrectly storing the access token in the
refresh_token cookie. This caused silent refresh to fail after page
reload since the short-lived access token couldn't be used for refresh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-08 20:49:41 +01:00
parent 779d90ca43
commit 1643db0e7b
2 changed files with 3 additions and 1 deletions

View file

@ -45,7 +45,7 @@ export class AuthController {
// Refresh-Token als HttpOnly Cookie setzen (NICHT im localStorage!)
// Regel: Kein localStorage fuer Tokens
this.setRefreshTokenCookie(res, result.accessToken);
this.setRefreshTokenCookie(res, result.refreshToken);
return {
accessToken: result.accessToken,

View file

@ -21,6 +21,7 @@ interface TokenPair {
interface LoginResponse {
accessToken: string;
refreshToken: string;
user: {
id: string;
email: string;
@ -151,6 +152,7 @@ export class AuthService {
return {
accessToken: tokens.accessToken,
refreshToken: tokens.refreshToken,
user: {
id: user.id,
email: user.email,