Skip to content

Commit

Permalink
Fix mikenicholson#17 where token missing in all forms of checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 23, 2015
1 parent 16da347 commit 436a4d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ JwtStrategy.prototype.authenticate = function(req, options) {
}

if (!token) {
token = url.parse(req.url, true).query[self._tokenQueryParameterName];
var parsed_url =url.parse(req.url, true);
if(parsed_url.query && parsed_url.query.hasOwnProperty(self._tokenQueryParameterName))
{
token = parsed_url.query[self._tokenQueryParameterName];
}
}


if (!token) {
return self.fail(new Error("No auth token"));
}
Expand Down

0 comments on commit 436a4d6

Please sign in to comment.