Polarcraft/web/server/utils/auth.js

10 lines
234 B
JavaScript

import jwt from 'jsonwebtoken'
const config = useRuntimeConfig()
export const createToken = (accessToken, refreshToken, maxAge) => {
return jwt.sign({ accessToken, refreshToken }, config.jwtSecret, {
expiresIn: maxAge,
})
}