mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add verification token generation
This commit is contained in:
parent
1346140a20
commit
bd5b289168
1 changed files with 9 additions and 0 deletions
|
|
@ -79,3 +79,12 @@ export const getClaimsByToken = async (
|
|||
|
||||
return claims
|
||||
}
|
||||
|
||||
export const generateVerificationToken = (userId: string) => {
|
||||
const iat = Math.floor(Date.now() / 1000)
|
||||
const exp = Math.floor(
|
||||
new Date(Date.now() + 1000 * 60 * 60 * 24).getTime() / 1000
|
||||
)
|
||||
|
||||
return jwt.sign({ uid: userId, iat, exp }, env.server.jwtSecret)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue