Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "fast-jwt", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Fast JSON Web Token implementation", | ||
@@ -5,0 +5,0 @@ "author": "NearForm Ltd", |
@@ -191,3 +191,6 @@ 'use strict' | ||
// Verify typ | ||
if (checkTyp && (typeof header.typ !== 'string' || checkTyp !== header.typ.toLowerCase().replace(/^application\//, ''))) { | ||
if ( | ||
checkTyp && | ||
(typeof header.typ !== 'string' || checkTyp !== header.typ.toLowerCase().replace(/^application\//, '')) | ||
) { | ||
throw new TokenError(TokenError.codes.invalidType, 'Invalid typ.') | ||
@@ -310,3 +313,3 @@ } | ||
return cacheSet(cacheContext, complete ? { header, payload, signature } : payload) | ||
return cacheSet(cacheContext, complete ? { header, payload, signature, input: token } : payload) | ||
} catch (e) { | ||
@@ -356,3 +359,3 @@ throw cacheSet(cacheContext, e) | ||
callback(null, cacheSet(cacheContext, complete ? { header, payload, signature } : payload)) | ||
callback(null, cacheSet(cacheContext, complete ? { header, payload, signature, input: token } : payload)) | ||
}) | ||
@@ -359,0 +362,0 @@ |
91193
1286