api/jwt: remove redundant exports

This commit is contained in:
wukko 2024-09-09 19:39:07 +06:00
parent ebd1104df3
commit de5162e417
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -11,7 +11,7 @@ const makeHmac = (header, payload) =>
.update(`${header}.${payload}`)
.digest("base64url");
export const generate = () => {
const generate = () => {
const exp = Math.floor(new Date().getTime() / 1000) + env.jwtLifetime;
const header = toBase64URL(JSON.stringify({
@ -32,7 +32,7 @@ export const generate = () => {
};
}
export const verify = (jwt) => {
const verify = (jwt) => {
const [header, payload, signature] = jwt.split(".", 3);
const timestamp = Math.floor(new Date().getTime() / 1000);