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

Commit

Permalink
Don’t mix options when signing tokens
Browse files Browse the repository at this point in the history
Fixes #254.
  • Loading branch information
marshallswain committed Aug 1, 2016
1 parent 6fafb6e commit 0edd5cc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/services/token.js
Expand Up @@ -116,16 +116,23 @@ export class Service {
const secret = this.options.secret;
const options = {
algorithm,
expiresIn,
notBefore,
audience,
issuer,
jwtid,
subject,
noTimestamp,
header
};

if (!data.iss) {
options.issuer = issuer;
}
if (!data.sub) {
options.subject = subject;
}
if (!data.exp) {
options.expiresIn = expiresIn;
}

// const data = {
// [this.options.idField]: payload[this.options.idField]
// };
Expand Down

0 comments on commit 0edd5cc

Please sign in to comment.