Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
feat(auth): allow changing the jwt expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Mar 12, 2020
1 parent 3561889 commit d934a61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const router = new Router()
const JWT_ISSUER = process.env.JWT_ISSUER || 'https://trompamusic.eu'
const JWT_SECRET = process.env.JWT_SECRET
const JWT_AUTH_KEYS = process.env.JWT_AUTH_KEYS ? JSON.stringify(process.env.JWT_AUTH_KEYS) : []
const JWT_EXPIRES = process.env.JWT_EXPIRES || '1d'

/**
* Health check endpoint
Expand Down Expand Up @@ -97,7 +98,7 @@ router.post('/jwt', async (req, res) => {

// generate token
const token = sign({ id, scopes }, JWT_SECRET, {
expiresIn: '1d',
expiresIn: JWT_EXPIRES,
issuer: JWT_ISSUER
})

Expand Down

0 comments on commit d934a61

Please sign in to comment.