Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: OAuth is not working properly. #439

Closed
songkg7 opened this issue May 3, 2023 · 5 comments
Closed

ERROR: OAuth is not working properly. #439

songkg7 opened this issue May 3, 2023 · 5 comments

Comments

@songkg7
Copy link

songkg7 commented May 3, 2023

I cloned the project and ran ./setup.sh --docker.

I was then able to access localhost:3000, but the OAuth login was not working properly.

Below is the output log.

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in 233ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()


> agent-gpt@0.2.0 start
> next start

warn  - You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /app/.env
[sentry] If Next.js logs a warning "API resolved without sending a response", it's a false positive, which may happen when you use `withSentry` manually to wrap your routes.
              To suppress this warning, set `SENTRY_IGNORE_API_RESOLUTION_ERROR` to 1 in your env.
              To suppress the nextjs warning, use the `externalResolver` API route option (see https://nextjs.org/docs/api-routes/api-middlewares#custom-config for details).
[next-auth][error][SIGNIN_OAUTH_ERROR]
https://next-auth.js.org/errors#signin_oauth_error client_id is required {
  error: {
    message: 'client_id is required',
    stack: 'TypeError: client_id is required\n' +
      '    at new BaseClient (/app/node_modules/openid-client/lib/client.js:178:13)\n' +
      '    at new Client (/app/node_modules/openid-client/lib/client.js:1789:7)\n' +
      '    at openidClient (/app/node_modules/next-auth/core/lib/oauth/client.js:29:18)\n' +
      '    at getAuthorizationUrl (/app/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:49)\n' +
      '    at Object.signin (/app/node_modules/next-auth/core/routes/signin.js:38:60)\n' +
      '    at AuthHandler (/app/node_modules/next-auth/core/index.js:260:39)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:22:19)\n' +
      '    at async NextAuth._args$ (/app/node_modules/next-auth/next/index.js:106:14)\n' +
      '    at async /app/node_modules/@sentry/nextjs/cjs/server/wrapApiHandlerWithSentry.js:136:35',
    name: 'TypeError'
  },
  providerId: 'github',
  message: 'client_id is required'
}
[sentry] If Next.js logs a warning "API resolved without sending a response", it's a false positive, which may happen when you use `withSentry` manually to wrap your routes.
              To suppress this warning, set `SENTRY_IGNORE_API_RESOLUTION_ERROR` to 1 in your env.
              To suppress the nextjs warning, use the `externalResolver` API route option (see https://nextjs.org/docs/api-routes/api-middlewares#custom-config for details).

What is mean client_id is required? Is there anything else I need to set up for OAuth login?

@songkg7 songkg7 changed the title OAuth is not working properly. ERROR. OAuth is not working properly. May 3, 2023
@songkg7 songkg7 changed the title ERROR. OAuth is not working properly. ERROR: OAuth is not working properly. May 3, 2023
@BigBangBit
Copy link

I have the same error running manually

@liemthanh-playgroundvina

change from line 22 of the setup.sh file:

ENV="NODE_ENV=development\n
NEXTAUTH_SECRET=$NEXTAUTH_SECRET\n
NEXTAUTH_URL=http://localhost:3000\n\
OPENAI_API_KEY=$OPENAI_API_KEY\n
DATABASE_URL=file:../db/db.sqlite\n
GOOGLE_CLIENT_ID=YOUR_ID\n
GOOGLE_CLIENT_SECRET=YOUR_ID\n
GITHUB_CLIENT_ID=YOUR_ID\n
GITHUB_CLIENT_SECRET=YOUR_ID\n
DISCORD_CLIENT_ID=YOUR_ID\n
DISCORD_CLIENT_SECRET=YOUR_ID\n"

And replace YOUR_ID

@a00110110011
Copy link

And replace YOUR_ID with what ? where do i get this mythical beast?

@a00110110011
Copy link

@awtkns
Copy link
Member

awtkns commented May 7, 2023

Fixed in #449, authentication providers are no longer needed when running locally :).

Please reopen is the issue persists.

@awtkns awtkns closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants