From 45e7a625fb97c186c71f69b1e91bc94b4ed98151 Mon Sep 17 00:00:00 2001 From: emrah Date: Fri, 15 Sep 2023 17:37:56 +0300 Subject: [PATCH] api, fix: number case for nbf and exp --- api/jitok.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/jitok.ts b/api/jitok.ts index 341a9b5..0e2b5d0 100644 --- a/api/jitok.ts +++ b/api/jitok.ts @@ -109,6 +109,12 @@ function validateInput(ps: Dict): Dict { } catch { throw new BadRequest("invalid nbf"); } + } else { + try { + ps.nbf = getNumericDate(ps.nbf); + } catch { + throw new BadRequest("invalid nbf"); + } } } // exp @@ -120,6 +126,12 @@ function validateInput(ps: Dict): Dict { } catch { throw new BadRequest("invalid exp"); } + } else { + try { + ps.exp = getNumericDate(ps.exp); + } catch { + throw new BadRequest("invalid exp"); + } } }