set expiresIn of JWT to 2 years

This commit is contained in:
Moriz Wahl 2021-03-04 16:36:22 +01:00
parent b1ca024f40
commit 5f0ed256d6

View File

@ -5,7 +5,7 @@ import CONFIG from './../config'
export default function encode(user) {
const { id, name, slug } = user
const token = jwt.sign({ id, name, slug }, CONFIG.JWT_SECRET, {
expiresIn: '1d',
expiresIn: '2y',
issuer: CONFIG.GRAPHQL_URI,
audience: CONFIG.CLIENT_URI,
subject: user.id.toString(),