Skip to content

Commit 0750a54

Browse files
committed
fix: update cookie handling to use access token instead of session identifier
1 parent 2826c3f commit 0750a54

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

apps/api/src/auth/auth.controller.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,11 @@ export class AuthController {
155155
profile,
156156
);
157157

158-
// Set HTTP-only cookie with an opaque session identifier instead of the raw access token.
159-
// The session identifier should be mapped server-side to the actual access token.
160-
res.cookie('access_token', result.sessionId, COOKIE_OPTIONS);
158+
// Set HTTP-only cookie with the access token
159+
res.cookie('access_token', result.access_token, COOKIE_OPTIONS);
161160

162161
// Redirect to frontend callback page
163-
// Session identifier in URL is kept for backward compatibility and as fallback
164-
res.redirect(`${frontendUrl}/auth/callback?token=${result.sessionId}`);
162+
res.redirect(`${frontendUrl}/auth/callback?token=${result.access_token}`);
165163
} catch (error) {
166164
if (
167165
error instanceof UnauthorizedException &&

0 commit comments

Comments
 (0)