File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,13 +134,13 @@ export class AuthController {
134134 profile ,
135135 ) ;
136136
137- // Set HTTP-only cookie - in monorepo deployment, this cookie works directly
138- // since frontend and API are on the same domain
139- res . cookie ( 'access_token' , result . access_token , COOKIE_OPTIONS ) ;
137+ // Set HTTP-only cookie with an opaque session identifier instead of the raw access token.
138+ // The session identifier should be mapped server-side to the actual access token.
139+ res . cookie ( 'access_token' , result . sessionId , COOKIE_OPTIONS ) ;
140140
141141 // Redirect to frontend callback page
142- // Token in URL is kept for backward compatibility and as fallback
143- res . redirect ( `${ frontendUrl } /auth/callback?token=${ result . access_token } ` ) ;
142+ // Session identifier in URL is kept for backward compatibility and as fallback
143+ res . redirect ( `${ frontendUrl } /auth/callback?token=${ result . sessionId } ` ) ;
144144 } catch ( error ) {
145145 if (
146146 error instanceof UnauthorizedException &&
You can’t perform that action at this time.
0 commit comments