mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Tidied up JWT tests
This commit is contained in:
parent
f4784d49e7
commit
24548e3a48
2 changed files with 5 additions and 5 deletions
|
@ -42,9 +42,11 @@ class JWTVerify extends Operation {
|
|||
*/
|
||||
run(input, args) {
|
||||
const [key] = args;
|
||||
const algos = JWT_ALGORITHMS;
|
||||
algos[algos.indexOf("None")] = "none";
|
||||
|
||||
try {
|
||||
const verified = jwt.verify(input, key, { algorithms: JWT_ALGORITHMS });
|
||||
const verified = jwt.verify(input, key, { algorithms: algos });
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(verified, "name") && verified.name === "JsonWebTokenError") {
|
||||
throw new OperationError(verified.message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue