itpropro / nuxt-oidc-auth

OIDC (OpenID connect) focused auth module for Nuxt
https://nuxtoidc.cloud
MIT License
71 stars 14 forks source link

Which name should we use as middleware when not using global middleware option #34

Closed victorlmneves closed 1 month ago

victorlmneves commented 4 months ago

Hi I have set the globalMiddlewareEnabled as false as I want to define manually which pages are protected. Doing this, which is the right name to use as middleware?

I have tried '00-oidc-auth', but it doesn't work

definePageMeta({
    middleware: ['00-oidc-auth']
})

Thanks

gheithen commented 4 months ago

@victorlmneves it doesn't really matter. I've made a custom middleware, and called it something with auth, where I utilize the useOidcAuth composable

victorlmneves commented 4 months ago

thanks @gheithen

itpropro commented 1 month ago

The naming is only important for the order, middlewares are loaded. If you use your own, it doesn't matter from a functionality perspective, as @gheithen mentioned. If you want to know more about middleware ordering, check this chapter in the Nuxt docs: https://nuxt.com/docs/guide/directory-structure/middleware#ordering-global-middleware