@bitblit/ratchet-common
Version:
Common tools for general use
11 lines • 524 B
JavaScript
import { jwtDecode } from 'jwt-decode';
import { JwtPayloadExpirationRatchet } from './jwt-payload-expiration-ratchet.js';
export class JwtDecodeOnlyRatchet {
static decodeTokenNoVerify(token, expiredHandling = 0, inDecodeFuntion) {
const decodeFunction = inDecodeFuntion ?? jwtDecode;
let decoded = decodeFunction(token);
decoded = JwtPayloadExpirationRatchet.processPayloadExpiration(decoded, expiredHandling);
return decoded;
}
}
//# sourceMappingURL=jwt-decode-only-ratchet.js.map