From a7e2cf0cceea274712a157b468783f92f5f3b198 Mon Sep 17 00:00:00 2001 From: Chris Johnson <49479599+workeffortwaste@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:17:40 +0000 Subject: [PATCH] Fix constructor error --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 951bf49..fbc0e42 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ class Base64URL { class JWT { constructor() { - if (!crypto || !crypto.subtle) + if (typeof crypto === 'undefined' || !crypto.subtle) throw new Error('Crypto not supported!') this.algorithms = { ES256: { name: 'ECDSA', namedCurve: 'P-256', hash: { name: 'SHA-256' } },