Fix constructor error
This commit is contained in:
2
index.js
2
index.js
@@ -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' } },
|
||||||
|
|||||||
Reference in New Issue
Block a user