diff --git a/src/utils/cookie.ts b/src/utils/cookie.ts index 5163246d..45797ddf 100644 --- a/src/utils/cookie.ts +++ b/src/utils/cookie.ts @@ -162,7 +162,7 @@ const _serialize = (name: string, value: string, opt: CookieOptions = {}): strin 'Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.' ) } - cookie += `; Max-Age=${Math.floor(opt.maxAge)}` + cookie += `; Max-Age=${opt.maxAge | 0}` } if (opt.domain && opt.prefix !== 'host') { diff --git a/src/utils/jwt/jwt.ts b/src/utils/jwt/jwt.ts index 23ab901d..b470e5b6 100644 --- a/src/utils/jwt/jwt.ts +++ b/src/utils/jwt/jwt.ts @@ -74,7 +74,7 @@ export const verify = async ( if (!isTokenHeader(header)) { throw new JwtHeaderInvalid(header) } - const now = Math.floor(Date.now() / 1000) + const now = (Date.now() / 1000) | 0 if (payload.nbf && payload.nbf > now) { throw new JwtTokenNotBefore(token) }