csquared / fernet.js

Javascript implementation of Fernet symmetric encryption https://github.com/kr/fernet-spec
MIT License
73 stars 29 forks source link

Support edge runtime #34

Open ArianHamdi opened 1 month ago

ArianHamdi commented 1 month ago

I am trying to use Fernet.js in the Next.js middleware to decrypt a user token, but the edge runtime only supports a limited subset of Node.js modules and does not support the crypto module. Instead, it requires the use of the Web Crypto API.

More on this: https://nextjs.org/docs/messages/node-module-in-edge-runtime

I want to know if there are any plans to support this runtime as well, or if there is any other implementation of Fernet that supports the edge runtime?

Thanks in advance.