1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-08 23:10:05 +00:00
Files
server/api/src/utils/generateAccessToken.ts
2021-11-11 03:40:57 +05:00

8 lines
208 B
TypeScript

import jwt from 'jsonwebtoken'
import { InfoJWT } from '../types'
export const generateAccessToken = (data: InfoJWT) =>
jwt.sign(data, process.env.ACCESS_TOKEN_SECRET as string, {
expiresIn: '1h'
})