Skip to content

Commit

Permalink
Merge pull request #81 from akmjenkins/feature/jwt-null-undefined
Browse files Browse the repository at this point in the history
Allow jwt to take null or undefined
  • Loading branch information
niftylettuce committed Feb 15, 2019
2 parents b23d7ea + 255ebfe commit 5fa9bc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class Frisbee {
}

jwt(token) {
if (token === null) delete this.headers.Authorization;
if (token === null || token === undefined) delete this.headers.Authorization;
else if (typeof token === 'string')
this.headers.Authorization = `Bearer ${token}`;
else throw new TypeError('jwt token must be a string');
Expand Down

0 comments on commit 5fa9bc4

Please sign in to comment.