Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/shared/utils/tc.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ export function getAuthTokens(req = {}) {
const cookies = req.cookies || {};
// Support both historical cookie names used across environments.
const authToken = cookies.tcjwt || cookies.tcJwt;
let tokenV2 = authToken;
let tokenV3 = authToken;
let tokenV2 = cookies.tcjwt;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The change from authToken to cookies.tcjwt for tokenV2 and tokenV3 assumes that cookies.tcjwt is always the correct token to use. If cookies.tcJwt is still valid in some environments, this change might break functionality. Consider verifying that cookies.tcjwt is the correct and only source for both tokens in all environments.

let tokenV3 = cookies.tcjwt;

if (!tokenV2 || isTokenExpired(tokenV2, config.AUTH_DROP_TIME)) {
tokenV2 = '';
Expand Down
Loading