Polarcraft/web/server/utils/auth.js

10 lines
234 B
JavaScript
Raw Normal View History

2023-04-23 10:15:25 +02:00
import jwt from 'jsonwebtoken'
const config = useRuntimeConfig()
export const createToken = (accessToken, refreshToken, maxAge) => {
return jwt.sign({ accessToken, refreshToken }, config.jwtSecret, {
expiresIn: maxAge,
})
}