ai-chatbot icon indicating copy to clipboard operation
ai-chatbot copied to clipboard

Unhandled Runtime Error - Unauthorized

Open fotoflo opened this issue 1 year ago • 4 comments

Your documentation tells us how to configure it but we don't have a url for the github oauth callback.

Somehow it seems to work unauthorized when deployed, but login doesnt work on either local or deployed version.

Unhandled Runtime Error Error: Unauthorized

Call Stack eval node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/ai/react/dist/index.mjs (120:0) Generator.next fulfilled node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/ai/react/dist/index.mjs (22:0)

And on prod: image

fotoflo avatar Jun 21 '23 07:06 fotoflo

Callback URL: https://github.com/vercel-labs/ai-chatbot/issues/28#issuecomment-1598975610

You are also likely missing a secret in prod, check the server logs as suggested on the image. (logs in the Vercel dashboard)

balazsorban44 avatar Jun 21 '23 07:06 balazsorban44

Also, this seems to be a duplicate report of #46, although neither has a sufficient reproduction attached. This should likely be closed in favor of #46 and a repro added there, if the above does not resolve your issue. :pray:

balazsorban44 avatar Jun 21 '23 07:06 balazsorban44

Hello, @balazsorban44 thansk for the response

i set the NEXTAUTH_URL="localhost:3000" in .env

no luck

fotoflo avatar Jun 21 '23 07:06 fotoflo

It's likely NEXTAUTH_SECRET that's missing. See the comments in https://github.com/vercel-labs/ai-chatbot/blob/main/.env.example

For further assistance, please provide a reproduction or more information about the server logs. :pray:

balazsorban44 avatar Jun 21 '23 08:06 balazsorban44

We now force login in all environments as well. This should be fixed. If you are seeing this error still please re-open.

jaredpalmer avatar Jun 22 '23 17:06 jaredpalmer

Hi I saw you closed this issure without updating the documentation on how to create a secret...

fotoflo avatar Jun 26 '23 09:06 fotoflo

Hi .. Facing same issue ... Is there any updated documentation ?

prasad123-hub avatar Jun 27 '23 02:06 prasad123-hub