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

Global or on-demand middleware throws 500 in console and error=undefined in url #479

Closed
jameswagoner opened this issue Jul 11, 2023 · 3 comments
Labels
closed-by-bot Closed by automation needs-reproduction Action needed: A valid reproduction of the issue needs to be added provider-authjs An issue with the authjs provider

Comments

@jameswagoner
Copy link

Environment

- Operating System: Darwin
- Node Version:     v16.16.0
- Nuxt Version:     3.6.2
- Nitro Version:    2.5.2
- Package Manager:  [email protected]
- Builder:          vite
- User Config:      components, devServer, vite, tailwindcss, modules, auth, nexusbroker, runtimeConfig
- Runtime Modules:  @vueuse/[email protected], @pinia/[email protected], @sidebase/[email protected], @nuxtjs/[email protected], [email protected], @vee-validate/[email protected]
- Build Modules:    -

Reproduction

Using private OAuth provider. Providing a repo to clone is not going to help.

Describe the bug

Going to a "protected" route, redirect happens but then another that appends error=undefined to the url in addition to a callbackUrl.

When I disable global middleware, I don't get that error when I go to my signin page.

Additional context

nuxt.cofig.js:

defaultProvider: 'nexus',
enableSessionRefreshPeriodically: 1000 * 60,
enableGlobalAppMiddleware: true,
addDefaultCallbackUrl: false,
globalMiddlewareOptions: {
  allow404WithoutAuth: true,
  addDefaultCallbackUrl: true
}

Logs

[nuxt] [request error] [unhandled] [500] The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of URLSearchParams                                                    4:48:24 PM
  at new NodeError (node:internal/errors:372:5)  
  at Function.from (node:buffer:323:9)  
  at ./node_modules/h3/dist/index.mjs:293:21  
  at runMicrotasks (<anonymous>)  
  at processTicksAndRejections (node:internal/process/task_queues:96:5)  
  at runNextTicks (node:internal/process/task_queues:65:3)  
  at processImmediate (node:internal/timers:437:9)  
  at async readBody (./node_modules/h3/dist/index.mjs:319:16)  
  at async readBodyForNext (./.nuxt/dev/index.mjs:609:12)  
  at async getInternalNextAuthRequestData (./.nuxt/dev/index.mjs:692:18)
@zoey-kaiser zoey-kaiser added needs-reproduction Action needed: A valid reproduction of the issue needs to be added provider-authjs An issue with the authjs provider and removed bug needs-reproduction Action needed: A valid reproduction of the issue needs to be added labels Feb 23, 2024
Copy link

Hello 👋

Please provide a reproduction for this issue 🙏

How can I create a reproduction?

Please use one of the following links to reproduce your issue.

Please ensure that the reproduction is as minimal as possible. This will allow us to isolate the issue as best as possible.

Here are some more amazing posts about the importance of reproductions:

1 similar comment
Copy link

Hello 👋

Please provide a reproduction for this issue 🙏

How can I create a reproduction?

Please use one of the following links to reproduce your issue.

Please ensure that the reproduction is as minimal as possible. This will allow us to isolate the issue as best as possible.

Here are some more amazing posts about the importance of reproductions:

Copy link

github-actions bot commented Mar 9, 2024

This issue was closed because it was open for 14 days without a reproduction.

@github-actions github-actions bot added the closed-by-bot Closed by automation label Mar 9, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-by-bot Closed by automation needs-reproduction Action needed: A valid reproduction of the issue needs to be added provider-authjs An issue with the authjs provider
Projects
None yet
Development

No branches or pull requests

2 participants