-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
defaultProvider in nuxt.config doesn't apply #531
Comments
Hi @BerzinsU 👋
I sadly was not able to reproduce this issue. In the video below you can see I have globalmiddleware enabled and the default provider of Screen.Recording.2023-10-11.at.18.54.02.mov
I setup some demo data for an Auth0 provider and this worked as well. Screen.Recording.2023-10-11.at.19.03.23.movI will close this issue, as the bug seemed to have been resolved since version 0.6.0-beta.2. Feel free to test it out again and let me know, otherwise we can reopen this issue and investigate your problem further! |
@zoey-kaiser the issue with ERROR [next-auth][error][OAUTH_CALLBACK_ERROR]
https://next-auth.js.org/errors#oauth_callback_error State cookie was missing. { error:
{ TypeError: State cookie was missing.
at Object.use (/path/to/projectnode_modules/.pnpm/next-auth@4.21.1_next@13.5.6_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/oauth/checks.js:103:23)
at oAuthCallback (/path/to/projectnode_modules/.pnpm/next-auth@4.21.1_next@13.5.6_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/oauth/callback.js:89:25)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.callback (/path/to/projectnode_modules/.pnpm/next-auth@4.21.1_next@13.5.6_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/routes/callback.js:52:11)
at async AuthHandler (/path/to/projectnode_modules/.pnpm/next-auth@4.21.1_next@13.5.6_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/index.js:201:28)
at Object.handler (/path/to/projectnode_modules/.pnpm/@sidebase+nuxt-auth@0.7.0_next-auth@4.21.1/node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs:88:24)
at async file:///path/to/projectnode_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1962:19
at async Object.callAsync (file:///path/to/projectnode_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)
at async Server.toNodeHandle (file:///path/to/projectnode_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:2249:7)
name: 'OAuthCallbackError',
code: undefined },
providerId: 'auth0',
message: 'State cookie was missing.' } A following sign-in attempt using the button then works. The issue occurs when the globally protected page is hit directly. We are on |
Environment
Reproduction
No response
Describe the bug
nuxt.config
Set
globalAppMiddleware
to true, anddefaultProvider
to any configured provider.When redirected to login, you are given the provider choice page not the providers' login page.
If
globalAppMiddleware
is set to false andawait signIn("github")
is explicitly used, it does open GitHubs OAuth flow immediately.Another issue is that not every configured provider is selected like this. If
await signIn("auth0")
is used, thenTry signing in with a different account.
error is shown on provider select. But clicking it there, does work. Maybe separate bug.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: