10 lines
234 B
JavaScript
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,
|
|
})
|
|
}
|