Merge pull request #8 from workeffortwaste/fix-constructor-error
Fix constructor error
This commit is contained in:
2
index.js
2
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' } },
|
||||
|
||||
Reference in New Issue
Block a user