Skip to content

Commit ac6ae1a

Browse files
committed
feat(security): add no-store cache headers to developer token endpoint
- Add comprehensive cache-control headers to prevent caching of bearer tokens - Implement no-store, no-cache, must-revalidate, and private directives - Include legacy Pragma and Expires headers for broader compatibility - Prevent intermediary proxies and browser caches from storing sensitive tokens Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com>
1 parent 30c46ad commit ac6ae1a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/lfx-one/src/server/controllers/profile.controller.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,13 @@ export class ProfileController {
647647
token_length: bearerToken.length,
648648
});
649649

650+
// Set cache headers to prevent caching of sensitive bearer tokens
651+
res.set({
652+
['Cache-Control']: 'no-store, no-cache, must-revalidate, private',
653+
Pragma: 'no-cache',
654+
Expires: '0',
655+
});
656+
650657
res.json(tokenInfo);
651658
} catch (error) {
652659
Logger.error(req, 'get_developer_token_info', startTime, error);

0 commit comments

Comments
 (0)