Zaubrik / djwt

Create and verify JSON Web Tokens (JWT) with Deno or the browser.
MIT License
225 stars 23 forks source link

Argument of type '"jwk"' is not assignable to parameter of type '"raw" | "pkcs8" | "spki". in Deno v1.18.1 #64

Closed so1ve closed 2 years ago

so1ve commented 2 years ago

Hello timonson! When I use oak-middleware-jwt (a package that uses djwt) + Deno v1.18.1, an error occurs:

error: TS2769 [ERROR]: No overload matches this call.
   The last overload gave the following error.
     Argument of type '"jwk"' is not assignable to parameter of type '"raw" | "pkcs8" | "spki"'.
     "jwk",
     ~~~~~~
     at https://deno.land/x/god_crypto@v1.4.9/src/rsa/rsa_wc.ts:55:5

TS2771 [ERROR]: The last overload is declared here.
         at asset:///lib.dom.d.ts:13442:5

Don't know if this is the cause of my PC or the djwt version is too low?

timonson commented 2 years ago

Hi @so1ve , it looks like the oak-middleware-jwt uses an older djwt version. The latest djwt versions use deno's native crypto API instead of the god_crypto library.

so1ve commented 2 years ago

Thank you for your answer!