mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 21:12:49 +08:00
fix(auth): race-safe first-run setup + rolling cookie max-age refresh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
fb7feec5cf
commit
ceb24595e6
6 files changed
+82
-8
No files matched your search
@@ -17,6 +17,11 @@ export function validateSessionFromHeaders(
|
||||
return sessions.validateAndTouch(token);
|
||||
}
|
||||
|
||||
export function extractSessionToken(rawCookieHeader: string | undefined): string | null {
|
||||
if (!rawCookieHeader) return null;
|
||||
return parseCookie(rawCookieHeader, SESSION_COOKIE_NAME);
|
||||
}
|
||||
|
||||
function parseCookie(header: string, name: string): string | null {
|
||||
for (const part of header.split(";")) {
|
||||
const trimmed = part.trim();
|
||||
|
||||
Reference in new issue
Block a user