1
0

Fix constructor error

This commit is contained in:
Chris Johnson
2022-02-24 09:17:40 +00:00
committed by GitHub
parent 430fa0eb84
commit 9c52217ca2

View File

@@ -9,7 +9,7 @@ class Base64URL {
class JWT { class JWT {
constructor() { constructor() {
if (!crypto || !crypto.subtle) if (typeof crypto === 'undefined' || !crypto.subtle)
throw new Error('Crypto not supported!') throw new Error('Crypto not supported!')
this.algorithms = { this.algorithms = {
ES256: { name: 'ECDSA', namedCurve: 'P-256', hash: { name: 'SHA-256' } }, ES256: { name: 'ECDSA', namedCurve: 'P-256', hash: { name: 'SHA-256' } },