-
- Notifications
You must be signed in to change notification settings - Fork 186
Closed
Labels
bugA bug that needs to be resolvedA bug that needs to be resolvedquestionA question about NuxtAuthA question about NuxtAuth
Description
Environment
- Operating System: Darwin
- Node Version: v20.19.2
- Nuxt Version: 4.1.1
- CLI Version: 3.28.0
- Nitro Version: 2.12.5
- Package Manager: pnpm@10.14.0
- Builder: -
- User Config: compatibilityDate, devtools, modules, css, runtimeConfig, fonts, auth, i18n, vite
- Runtime Modules: @nuxt/eslint@1.9.0, @nuxt/fonts@0.11.4, @nuxtjs/i18n@10.0.6, @sidebase/nuxt-auth@1.0.2
- Build Modules: -
Reproduction
.
Describe the bug
Hi,
I've been trying to implement this plugin with the Keycloak provider, but I'm facing some weird issues.
So, I use a custom login screen like so:
When I click the login button, I'm properly redirected to Keycloak:
Once connected, I'm properly redirected to my app main page (currently empty):
But if I try to go to my app main page without being logged-in, I get redirected to this page, but only if I use the globalAppMiddleware like so:
// nuxt.config.js { ... auth: { baseURL: 'http://localhost:3000/api/auth', globalAppMiddleware: true, disableInternalRouting: true, provider: { type: 'authjs', trustHost: false, addDefaultCallbackUrl: true, }, }, ... } // dashboard.vue definePageMeta({ auth: { unauthenticatedOnly: false, navigateUnauthenticatedTo: '/', }, });
I don't want the pre-made login page, but I can't find anywhere in the doc how to disable it completely.
If I disable the globalMiddleware and add middleware: ['sidebase-auth'] like so, it works properly.
// nuxt.config.js { ... auth: { baseURL: 'http://localhost:3000/api/auth', globalAppMiddleware: false, disableInternalRouting: true, provider: { type: 'authjs', trustHost: false, addDefaultCallbackUrl: true, }, }, ... } // dashboard.vue definePageMeta({ middleware: 'sidebase-auth', auth: { unauthenticatedOnly: false, navigateUnauthenticatedTo: '/', }, });Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
bugA bug that needs to be resolvedA bug that needs to be resolvedquestionA question about NuxtAuthA question about NuxtAuth