Confused about what's needed for JWT encryption to work w/o warnings #1718
Replies: 2 comments 3 replies
-
@mAAdhaTTah If you're using TypeScript exclusively, I found some of the same errors when I was trying to setup provider clientIds and Secrets. The following helped me, let me know if it helps!
namespace NodeJS {
interface ProcessEnv {
//Keys and Types go here.
// ex. JWT_AUTO_GENERATED_SIGNING_KEY: string;
}
} If I'm off on my answer here, I apologize! |
Beta Was this translation helpful? Give feedback.
-
Hi @mAAdhaTTah ,
Update jun 11 2020
It should look something like this:
jwt: {
secret: 'INp8IvdIyeMcoGAgFGoA61DdBglwwSqnXJZkgz8PSnw',
signingKey: process.env.JWT_SIGNING_PRIVATE_KEY,
}
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking at a few things: https://next-auth.js.org/configuration/options#jwt which has this info about
secret
,signingKey
,encryptionKey
anddecryptionKey
. ThedecryptionKey
, according to the docs, will be the same as theencryptionKey
unless specified.However, I started getting
JWT_AUTO_GENERATED_SIGNING_KEY
&JWT_AUTO_GENERATED_ENCRYPTION_KEY
warnings as I started setting things up, so I found this: https://github.com/nextauthjs/next-auth/blob/76df2b5e702be2084674c81e098d989c2ec39ed9/www/docs/warnings.md which suggests setting thesigningKey
&verificationKey
. TheverificationKey
is not in the docs nor in the TypeScript types, so I'm not 100% sure it exists. Additionally, the section in warnings forJWT_AUTO_GENERATED_ENCRYPTION_KEY
is empty, which initially took to mean it would be solved the same way as theJWT_AUTO_GENERATED_SIGNING_KEY
but that does not seem to be the case.So questions:
verificationKey
even a thing and do I need it to configure encrypted JWTs?I'm happy to update the docs to match all of this since I'm working on it currently but need some guidance as to what's correct to do so.
Beta Was this translation helpful? Give feedback.
All reactions