nextauth-jwe-decrypt
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

NextAuth JWE Decrypt

This package is created for personal purposes as a utility for decrypting the JWE issued by NextAuth when using the token in an external API.

USAGE

import decrypt from 'nextauth-jwe-decrypt';

const nextauthSecret = process.env.NEXTAUTH_SECRET;


// Token can be extracted with getToken({req,raw:true}) inside api routes or from
// `next-auth.session.token` cookie.

const nextauthToken = 'your-next-auth-token-here'

const payload = await decrypt(nextauthToken,nextauthSecret) // returns undefined if no secret is provided

doSomethingWithPayload(payload)

Package Sidebar

Install

npm i nextauth-jwe-decrypt

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

11.4 kB

Total Files

10

Last publish

Collaborators

  • varadarajan_m