add verification token generation
This commit is contained in:
committed by
Jackson Harper
parent
1346140a20
commit
bd5b289168
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user