mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-04 06:06:07 +00:00
api/jwt: remove redundant exports
This commit is contained in:
parent
ebd1104df3
commit
de5162e417
|
@ -11,7 +11,7 @@ const makeHmac = (header, payload) =>
|
||||||
.update(`${header}.${payload}`)
|
.update(`${header}.${payload}`)
|
||||||
.digest("base64url");
|
.digest("base64url");
|
||||||
|
|
||||||
export const generate = () => {
|
const generate = () => {
|
||||||
const exp = Math.floor(new Date().getTime() / 1000) + env.jwtLifetime;
|
const exp = Math.floor(new Date().getTime() / 1000) + env.jwtLifetime;
|
||||||
|
|
||||||
const header = toBase64URL(JSON.stringify({
|
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 [header, payload, signature] = jwt.split(".", 3);
|
||||||
const timestamp = Math.floor(new Date().getTime() / 1000);
|
const timestamp = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue