Skip to content

Commit

Permalink
Merge pull request #4 from leobeckp/468-jwt-expiration
Browse files Browse the repository at this point in the history
PR 468 (pantsel#468)
  • Loading branch information
leobeckp authored Jan 8, 2022
2 parents 0d4be7f + e219ff8 commit f219359
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/policies/authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = function authenticated(request, response, next) {
return response.json(401, {message: 'Given authorization token is not valid', logout: true});
} else {
// Store user id to request object
request.token = token;
request.token = token.id.toString();

// We delete the token from query and body to not mess with blueprints
request.query && delete request.query.token;
Expand Down
3 changes: 2 additions & 1 deletion api/services/Token.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module.exports.issue = function issue(payload) {

return jwt.sign(
payload, // This is the payload we want to put inside the token
process.env.TOKEN_SECRET || "oursecret" // Secret string which will be used to sign the token
process.env.TOKEN_SECRET || "oursecret", // Secret string which will be used to sign the token
{ expiresIn: parseInt(process.env.KONGA_JWT_TOKEN_EXPIRY || 60 * 60 )}
);
};

Expand Down

0 comments on commit f219359

Please sign in to comment.