diff --git a/lib/models/access-token.js b/lib/models/access-token.js index 14e57326..3ea22d35 100644 --- a/lib/models/access-token.js +++ b/lib/models/access-token.js @@ -174,13 +174,14 @@ function tokenIdForRequest(req, options) { } } - for(i = 0, length = headers.length; i < length; i++) { - id = req.signedCookies[cookies[i]]; + if(req.signedCookies) { + for(i = 0, length = headers.length; i < length; i++) { + id = req.signedCookies[cookies[i]]; - if(typeof id === 'string') { - return id; + if(typeof id === 'string') { + return id; + } } } - return null; }