mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 08:31:29 +00:00
fix: harden input validation, redirect safety, and error resilience
This commit is contained in:
parent
d419b9c940
commit
bd33fa6835
8 changed files with 208 additions and 97 deletions
|
|
@ -39,11 +39,11 @@ export async function createAdminSession(
|
|||
}
|
||||
|
||||
export function adminCookie(sessionId: string): string {
|
||||
return `${SESSION_COOKIE}=${sessionId}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${SESSION_TTL}`;
|
||||
return `${SESSION_COOKIE}=${sessionId}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=${SESSION_TTL}`;
|
||||
}
|
||||
|
||||
export function clearAdminCookie(): string {
|
||||
return `${SESSION_COOKIE}=; Path=/; HttpOnly; SameSite=Lax; Max-Age=0`;
|
||||
return `${SESSION_COOKIE}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0`;
|
||||
}
|
||||
|
||||
function parseCookies(header: string | undefined): Record<string, string> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue