mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 13:56:39 +00:00
fix access token session do not extend and make domains lower case
This commit is contained in:
@@ -105,7 +105,7 @@ export async function authWithAccessToken(
|
||||
);
|
||||
}
|
||||
|
||||
const validCode = await verifyPassword(tokenItem.tokenHash, accessToken);
|
||||
const validCode = await verifyPassword(accessToken, tokenItem.tokenHash);
|
||||
|
||||
if (!validCode) {
|
||||
return next(
|
||||
@@ -132,7 +132,7 @@ export async function authWithAccessToken(
|
||||
accessTokenId: tokenItem.accessTokenId,
|
||||
sessionLength: tokenItem.sessionLength,
|
||||
expiresAt: tokenItem.expiresAt,
|
||||
doNotExtend: tokenItem.expiresAt ? false : true
|
||||
doNotExtend: tokenItem.expiresAt ? true : false
|
||||
});
|
||||
const cookieName = `${config.server.resource_session_cookie_name}_${resource.resourceId}`;
|
||||
const cookie = serializeResourceSessionCookie(cookieName, token);
|
||||
|
||||
@@ -51,7 +51,9 @@ export async function createResource(
|
||||
);
|
||||
}
|
||||
|
||||
const { name, subdomain } = parsedBody.data;
|
||||
let { name, subdomain } = parsedBody.data;
|
||||
|
||||
subdomain = subdomain.toLowerCase(); // always to lower case
|
||||
|
||||
// Validate request params
|
||||
const parsedParams = createResourceParamsSchema.safeParse(req.params);
|
||||
|
||||
Reference in New Issue
Block a user