Next.js Discord

Discord Forum

NEED HELP

Answered
European pilchard posted this in #help-forum
Open in Discord
European pilchardOP
Hello guys ,
I was doing a project from YouTune and after deploying the project to vercel I'm not able to see my sign in button (i'm using Google Provider ) I tried to console providers but it returns null . But in localhost its working fine but i got issue after deploying to vercel . Please help
Answered by ncls.
You ahave to define a secret in your NextAuth configuration. Read more here: https://next-auth.js.org/configuration/options#secret
View full answer

13 Replies

European pilchardOP
Can you view the server logs?
European pilchardOP
i'm sorry can you guide me how to view it , this is just my first project on vercel
European pilchardOP
well all red here
[next-auth][error][NO_SECRET]
https://next-auth.js.org/errors#no_secret Please define a secret in production. MissingSecret [MissingSecretError]: Please define a secret in production.
at assertConfig (/var/task/.next/server/chunks/921.js:6938:16)
at AuthHandler (/var/task/.next/server/chunks/921.js:6480:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async NextAuthRouteHandler (/var/task/.next/server/chunks/921.js:9662:30)
at async NextAuth._args$ (/var/task/.next/server/chunks/921.js:9696:24)
at async /var/task/.next/server/chunks/255.js:6171:37 {
code: 'NO_SECRET'
}
Answer
European pilchardOP
is there any mistake in this?
@European pilchard is there any mistake in this?
Yes, either add it manually to your config using the secret option I just sent you a link for or rename it to NEXTAUTH_SECRET
European pilchardOP
THANK YOU SO MUCH , certainly not proud of myself , wasted 2 hours on this should've asked it earlier . Lesson learnt