Created
April 11, 2023 16:11
-
-
Save koolamusic/db172285b1c44f19f1592d5e52c02019 to your computer and use it in GitHub Desktop.
JWT utilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @see https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/jwt.ts | |
import { hkdf } from "@panva/hkdf" | |
import { EncryptJWT, jwtDecrypt } from "jose" | |
/// @see also https://github.com/panva/paseto | |
async function getDerivedEncryptionKey(secret: string) { | |
return await hkdf( | |
"sha256", | |
secret, | |
"", | |
"Auth.js Generated Encryption Key", | |
32 | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment