skip to Main Content

This is the logsenter image description here
I have built an amazon clone and when i deployed it to vercel the signin with google is not working, and i got this error:
Server error
There is a problem with the server configuration.

Check the server logs for more information.

i have added my environement variables

3

Answers


  1. Chosen as BEST ANSWER

    I have resolved this issue , if added uri on the cridentials of my project on google cloud platform and i added also a NEXTAUTH_SERET and redeployed the build THank you everyone


  2. Kindly share screenshot of the browser console so we can get some more clarity on the error.

    I had also faced a similar error once, I’ll tell you how I resolved it. It may work out for you as well.

    1. Check in your .env file if you have changed the callback URL to the deployment url and not localhost

    2. You may need to generate a Nextauth secret key. You can easily do so by running the below command.

      openssl rand -base64 32

    This will give you a alphanumeric string. Copy and paste that as NEXTAUTH_SECRET = ‘generated-value’ in the .env file

    Then in your pages/api/auth/[…nextauth.js] file, add this secret as well like shown below.

    import NextAuth from "next-auth"
    import GoogleProvider from "next-auth/providers/google"
    
    export default NextAuth({
      providers: [
        GoogleProvider({
          clientId: process.env.GOOGLE_CLIENT_ID,
          clientSecret: process.env.GOOGLE_CLIENT_SECRET,
        }),
        secret: process.env.NEXTAUTH_SECRET
      ],
    })
    

    If this works out it’s good, else you have to share your console log’s screenshot so we can debug further if needed.

    Login or Signup to reply.
  3. hi I had the same problem and I added NEXTAUTH_SECRET and it show an error with secret: process.env.NEXTAUTH_SECRET

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search