Git Product home page Git Product logo

Comments (7)

BracketJohn avatar BracketJohn commented on July 23, 2024 1

As much as I would like this, I don't think that we should rip apart the NuxtAuthHandler config -> from that point onwards the advantage of having many guides, tutorials, ... from NextAuth that also apply to nuxt-auth vanishes.

If we could import from the server side from our client-code it may be something different. Our middleware could import the auth handler and try to read the configuration from it. But ofc. that's also super dangerous because the nuxt auth handler could also contain secrets.

from nuxt-auth.

JoaoPedroAS51 avatar JoaoPedroAS51 commented on July 23, 2024 1

As much as I would like this, I don't think that we should rip apart the NuxtAuthHandler config -> from that point onwards the advantage of having many guides, tutorials, ... from NextAuth that also apply to nuxt-auth vanishes.

Yeah, that's exactly my point.

from nuxt-auth.

JoaoPedroAS51 avatar JoaoPedroAS51 commented on July 23, 2024

Yeah, I also thought about having path matching with next-auth pages. But we can't import the auth options as they are defined by the user in [...].ts, so we would need to add the auth.pages to nuxt.config and merge them into NuxtAuthHandler.

from nuxt-auth.

JoaoPedroAS51 avatar JoaoPedroAS51 commented on July 23, 2024

So your idea is something like ignorePaths: ['/foo', '/bar'], right?

from nuxt-auth.

BracketJohn avatar BracketJohn commented on July 23, 2024

Yes, that's it! I haven't looked into it, but it would be nice to follow the same patterns that nitro uses for routeRules: https://nitro.unjs.io/config/#routerules

Maybe the naming can be publicPaths instead of ignorePaths? This naming would be more independent of the global-middleware context. Or maybe even better, restructure the global middleware settings to allow:

enableGlobalAppMiddleware: boolean | {
  enabled: boolean
  ignoresPaths: string[]
}

from nuxt-auth.

BracketJohn avatar BracketJohn commented on July 23, 2024

I've added this note to the new docs, see #90 and soon https://sidebase.io/nuxt-auth/application-side/custom-sign-in-page

I've moved my proposal to allow ignore Paths into #91.

Closing this via #90

from nuxt-auth.

BracketJohn avatar BracketJohn commented on July 23, 2024

This was added with #90

from nuxt-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.