Skip to content

Commit

Permalink
Addressing PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
charliesantos committed Oct 23, 2020
1 parent e08563a commit 1a7c59b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/jwt/AccessToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ _.extend(AccessToken.prototype, {
typ: 'JWT'
};

if (this.region && typeof this.region === 'string') {
if (this.region && _.isString(this.region)) {
header.twr = this.region;
}

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/jwt/AccessToken.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('AccessToken', function() {
});

['', undefined, null, {}, 1, 0].forEach(function(value) {
it('should not twr header if region is ' + value, function() {
it('should not add twr header if region is ' + value, function() {
var token = new twilio.jwt.AccessToken(accountSid, keySid, secret, {region: value});
var decoded = jwt.decode(token.toJwt(), {complete: true});

Expand All @@ -67,7 +67,7 @@ describe('AccessToken', function() {
});
});

it('should accept different algorithm', function() {
it('should accept different algorithms', function() {
var validateAlg = function(alg) {
var token = new twilio.jwt.AccessToken(accountSid, keySid, 'secret');
var decoded = jwt.decode(token.toJwt(alg), {
Expand Down

0 comments on commit 1a7c59b

Please sign in to comment.