Fix wrong expiry date in token generation endpoint
This commit is contained in:
parent
41bf8d80dc
commit
210c457e72
|
@ -44,7 +44,7 @@ export const POST: APIRoute = async({ request }) => {
|
||||||
const username = Buffer.from(data.username).toString('base64url');
|
const username = Buffer.from(data.username).toString('base64url');
|
||||||
const random = randomBytes(16).toString("base64url");
|
const random = randomBytes(16).toString("base64url");
|
||||||
const randomHashed = createHash("sha256").update(random).digest("hex");
|
const randomHashed = createHash("sha256").update(random).digest("hex");
|
||||||
const expiresIn = data.duration ?? 86400000
|
const expiresIn = data.duration * 1000 ?? 86400000
|
||||||
|
|
||||||
const tokenString = `A.${timestamp}.${username}.${random}`;
|
const tokenString = `A.${timestamp}.${username}.${random}`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue