After checking the documentation it says that .env or [..nextAuth.js] file you should set a secret property in the configuration.
Error documentation to nextAuth
.env
NEXTAUTH_URL = "http://localhost:3000"
NEXTAUTH_SECRET_KEY="test"
[...nextAuth.js]
secret: "test",
jwt: {
secret: "test",
encryption: true,
maxAge: 5 * 60,
},
pages: {
signIn: "/auth/login",
},
However, this is a requirement only if you are in production, but I am not. How to fix this error and set it on development, not in production?
CodePudding user response:
Yeah the new environment variable is called simply NEXTAUTH_SECRET
.
Also when this is set, you can avoid setting the secret
and jwt.secret
values separately in the configuration.