Skip to content

Commit

Permalink
api, fix: number case for nbf and exp
Browse files Browse the repository at this point in the history
  • Loading branch information
emrahcom committed Sep 15, 2023
1 parent 5a4ee51 commit 45e7a62
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/jitok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
}
}
}

Expand Down

0 comments on commit 45e7a62

Please sign in to comment.