Closed yincangshiwei closed 1 week ago
👀 @yincangshiwei
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
📦 Deployment environment
Docker
1.16.1
Other Linux
Chrome
I am using logto. After configuring all environments, there is a problem with login/registration. When I click in, the following error appears: [auth][error] UnknownAction: Cannot parse action at /api/auth/session .Read more at https://errors.authjs.dev#unknownaction at /app/.next/server/chunks/35411.js:1:36999 at tx (/app/.next/server/chunks/35411.js:1:37314) at im (/app/.next/server/chunks/35411.js:357:46362) at t (/app/.next/server/chunks/35411.js:357:56511) at /app/nodemodules/.pnpm/next@14.2.9@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._5qe6vzi7lz36zngmhhqssoddee/node_modules/next/dist/compiled /next-server/app-route.runtime.prod.js:6:36938 at /app/nodemodules/.pnpm/next@14.2.9@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._5qe6vzi7lz36zngmhhqssoddee/node_modules/next/dist/server /lib/trace/tracer.js:140:36 at NoopContextManager.with (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19) at ContextAPI.with (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/api/context.js:60:46) at NoopTracer.startActiveSpan (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js:65:31) at ProxyTracer.startActiveSpan (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js:36:24) logto configuration: Lobe service environment configuration:
No response
No response
No response
To resolve the "UnknownAction: Cannot parse action at /api/auth/session" error in your Next.js application using Logto for authentication, ensure that the following environment variables are correctly configured:
NEXT_AUTH_SECRET
: This is required to encrypt Auth.js session tokens. You can generate a key using the command:
openssl rand -base64 32
NEXT_AUTH_SSO_PROVIDERS
: Set this to logto
to select Logto as the single sign-on provider for LobeChat.
LOGTO_CLIENT_ID
: The Client ID from the Logto App details page.
LOGTO_CLIENT_SECRET
: The Client Secret from the Logto App details page.
LOGTO_ISSUER
: The OpenID Connect issuer of the Logto provider. This should be:
https://lobe-auth-api.example.com/oidc
if you are using a privately deployed Logto.https://example.logto.app/oidc
if you are using Logto Cloud.NEXTAUTH_URL
(Optional): This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. For example:
https://lobe.example.com/api/auth
Ensure these environment variables are set correctly in your LobeChat environment configuration. Here is an example of how to set them:
NEXT_AUTH_SECRET=your_generated_secret
NEXT_AUTH_SSO_PROVIDERS=logto
LOGTO_CLIENT_ID=your_logto_client_id
LOGTO_CLIENT_SECRET=your_logto_client_secret
LOGTO_ISSUER=https://example.logto.app/oidc
NEXTAUTH_URL=https://lobe.example.com/api/auth
After setting these variables, redeploy your application to apply the changes. This should resolve the "UnknownAction: Cannot parse action at /api/auth/session" error [1][2].
To continue talking to Dosu, mention @dosu.
✅ @yincangshiwei
This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。
📦 部署环境
Docker
📌 软件版本
1.16.1
💻 系统环境
Other Linux
🌐 浏览器
Chrome
🐛 问题描述
我使用的是logto,配置好所有环境后,就剩登录/注册那里有问题了,点击进去就提示下面错误: [auth][error] UnknownAction: Cannot parse action at /api/auth/session .Read more at https://errors.authjs.dev#unknownaction at /app/.next/server/chunks/35411.js:1:36999 at tx (/app/.next/server/chunks/35411.js:1:37314) at im (/app/.next/server/chunks/35411.js:357:46362) at t (/app/.next/server/chunks/35411.js:357:56511) at /app/nodemodules/.pnpm/next@14.2.9@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._5qe6vzi7lz36zngmhhqssoddee/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36938 at /app/nodemodules/.pnpm/next@14.2.9@babel+core@7.23.6_supports-color@8.1.1@opentelemetry+api@1.9.0_react-dom@18.3._5qe6vzi7lz36zngmhhqssoddee/node_modules/next/dist/server/lib/trace/tracer.js:140:36 at NoopContextManager.with (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19) at ContextAPI.with (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/api/context.js:60:46) at NoopTracer.startActiveSpan (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js:65:31) at ProxyTracer.startActiveSpan (/app/node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js:36:24) logto配置: lobe服务环境配置:
📷 复现步骤
No response
🚦 期望结果
No response
📝 补充信息
No response