mirror of
https://github.com/sasjs/server.git
synced 2026-01-10 16:00:05 +00:00
feat: make access token duration configurable when creating client/secret
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import jwt from 'jsonwebtoken'
|
||||
import { InfoJWT } from '../types'
|
||||
|
||||
export const generateAccessToken = (data: InfoJWT) =>
|
||||
export const generateAccessToken = (data: InfoJWT, expiry?: number) =>
|
||||
jwt.sign(data, process.secrets.ACCESS_TOKEN_SECRET, {
|
||||
expiresIn: '1day'
|
||||
expiresIn: expiry ? `${expiry}d` : '1d'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user