mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 18:14:53 +02:00
allow controlling cors from config and add cors middleware to traefik
This commit is contained in:
parent
7ff5376d13
commit
ab18e15a71
8 changed files with 98 additions and 43 deletions
|
@ -120,7 +120,8 @@ export async function login(
|
|||
|
||||
const token = generateSessionToken();
|
||||
await createSession(token, existingUser.userId);
|
||||
const cookie = serializeSessionCookie(token);
|
||||
const isSecure = req.protocol === "https";
|
||||
const cookie = serializeSessionCookie(token, isSecure);
|
||||
|
||||
res.appendHeader("Set-Cookie", cookie);
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ export async function logout(
|
|||
|
||||
try {
|
||||
await invalidateSession(sessionId);
|
||||
res.setHeader("Set-Cookie", createBlankSessionTokenCookie());
|
||||
const isSecure = req.protocol === "https";
|
||||
res.setHeader("Set-Cookie", createBlankSessionTokenCookie(isSecure));
|
||||
|
||||
return response<null>(res, {
|
||||
data: null,
|
||||
|
|
|
@ -158,7 +158,8 @@ export async function signup(
|
|||
|
||||
const token = generateSessionToken();
|
||||
await createSession(token, userId);
|
||||
const cookie = serializeSessionCookie(token);
|
||||
const isSecure = req.protocol === "https";
|
||||
const cookie = serializeSessionCookie(token, isSecure);
|
||||
res.appendHeader("Set-Cookie", cookie);
|
||||
|
||||
if (config.getRawConfig().flags?.require_email_verification) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue