-
Notifications
You must be signed in to change notification settings - Fork 925
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
[Important] Auth Module State #893
Comments
@pi0 Thanks for the update. I have a product using this module for oauth in production right now. It works, though with minor issues - unfortunately none of which are on your list of v5 requirements. It seems that your suggestion is that I drop this module and hand-code my own solution? Since none of your alternative packages support oauth. A few of us have offered to step up and help maintain. For example, there are quite a few PRs for simple README and documentation updates that haven't been commented on. Are you open to that, instead? |
@bmulholland Glad to hear that. Actually current version is basically working but there is yet a big gap in documentation, DX and with small bugs as mentioned.
That's for sure! Please ping me on discord if interested to help for issue triage and maintenance :) |
I saw one of your tweets (few days ago ?) saying that you had some hard time sometimes with OSS. I hope you feel better now... 😄 Thanks for this module. ❤️
And looking at it afterwards, the struggle was not that big, the configuration looks slick and it's working great. I do still have some real concerns about the whole Meanwhile, you did a great job here ! So yeah, the documentation is maybe not crystal clear and few things are missing here and there but I wanted to send a huge thank you for your time and work ! 🙏🏻 |
Where can I find the documentation for the v4? |
Same question. And if someone is interested: import type { Auth } from '@nuxtjs/auth-next'
export default function ({ $auth }: { $auth: Auth }, inject: any) {
console.log({ $auth })
if (!$auth || !$auth.loggedIn) {
return
}
} $auth undefined
{
modules: [
'@nuxtjs/auth-next'
],
auth: {
plugins: [ '@/plugins/api' ]
}
} $auth defined
{
modules: [
'@nuxtjs/auth-next'
],
auth: {
plugins: [ '@/plugins/api.ts' ]
}
} |
v4 docs are here: https://github.com/nuxt-community/auth-module/tree/master/docs It would be very helpful to us if you could share why auth-next isn't working for you, though. We can't fix it if we don't know :) |
I'm doing some freelance jobs with nuxt-auth which already have the v4 implemented and I don't want to spend time to rewrite it to use the v5. |
The old plugin docs were removed ? I'm trying to find them, but I didn't yet |
Hi @AllanPinheiroDeLima! You can find the docs of auth v4 here |
Hi. Does @nuxtjs/auth-next support nuxt 3 app? |
@hardcommitoneself ive been using this plugin with nuxt-bridge with no problems. I have updated to use the new composition api and to eventually migrate to nuxt3. If you have an already built application, I would suggest going on bridge first. Otherwise, I think it will work just fine, if you already how the module |
Thanks, @AllanPinheiroDeLima. The following is my problem when I run build. Many thansk! |
@hardcommitoneself i can definitely say that I didn’t come across this error. I’ve had other errors, but most of them related to vite and nitro. Have ou tried to disable nitro in nuxt config to test it out? |
Before I add '@nuxtjs/auth-next' in nuxt.config.ts, it is working well. But after added, the error occurs. |
@hardcommitoneself there are other commenters on the issues saying that the plugin is not compatible with Nuxt3 I can say, definetely that with nuxt bridge it is working fine, because I'm using it right now. But to make this plugin ( and NuxtI18nModule ) work, I had to disable Nitro and Vite. |
So, what is happening with the official Auth Module? |
@Vinccool96 still in the works if I'm not mistaken. 😊 |
Is there a repo where we could help? |
Thanks, I updated the readme and the main comment with these. cc: @pilcrowonpaper, is this the best link for Nuxt users? |
Not to be snarky, but it's 2024 and we don't have an official auth for Nuxt 3 |
Don't be snarky then. :) If we don't have a Nuxt-team signed module for auth is because the 3rd party modules that other people created are quite good. You don't have any success with let's say Lucia? What are your exact needs in terms of Auth that this one does not achieve? 🤗 |
I might be wrong but Lucia requires that I set up a database and set up Lucia on the backend Which I can't do because the backend uses JWT for auth, there's no database, plus it authenticates with Gumroad's API The other auth modules (sidebase for example) are lacking on stability, features, and have edge issues with hybrid Nuxt That's my main concern, that I cannot publish an update from Nuxt 2 to 3 for my website because there is not 100% working JWT refresh auth library for Nuxt 3 |
Please checkout nuxt-auth-utils from @atinux. It is the latest effort for stable auth support. |
I don't see how you can do any sort of auth without a backend/database honestly since you need to handshake the JWT at some point with a service (maybe your own or Gumroad's). As stated in the comment above, Sébastien did a lot of working examples so you could maybe find a solution there. 😋 I gonna work on some Auth myself soon, considering giving a try to Appwrite/Supabase the middleman service in this case. Maybe those can also fit your needs if you want a hosted solution ready to go. |
As an aside, it would be nice for the roadmap to be updated to reflect the current plans. I can see a core auth module is in "Planned" and depends on "session support" but i can't see any status for this. |
@samturrell maybe come to the Nuxt Discord call this evening to discuss that one further (if you can!). 🤗 |
Thanks for your patience There's no database since all users are managed by Gumroad, but there is a backend that talks to Gumroad Just read the documentation for nuxt-auth-utils but seems like there is no support for JWT, only Oauth I intend to avoid all 3rd party services like supabase, since all I need is Gumroad Auth to be shared on the client and backend, but thanks for the suggestion Will have to do as you said and open relevant issues on other auth projects like sidebase |
@AlejandroAkbal really depends on how custom you want things to be. You could maybe achieve it with some Nitro server routes + middleware. If you do not want any 3rd party services in between, then a custom solution is still the way to go IMO (JWT is quite well-known nowadays and if you don't need any complex workflow, reading some blog posts on how to integrate Gumroad's API with JS may be enough, then a matter of porting it to Nuxt). The mentioned projects above are probably a decent start overall. |
@AlejandroAkbal if you use a backend for Auth like Gumroad, all you have to do is to store the JWT in a cookie using |
What about support with Auth0. I actually want to use NuxtJs to pre-render my pages for SEO and not much SSR. But so far I have not figure out how to use Auth0 with Nuxt3. |
I understand that Nuxt team had much to be done, but I disagree with the notion of "XYZ is not important because there are community packages for that". By that logic, NuxtUI would not have existed, since there are a dozen of UI libraries out there for nuxt 3: PrimeVue, Vuetify, Quasar,... And if you ask me, Auth is more important than UI libs, especially when Nuxt 2 doesnt even have a UI lib Every core feature of Nuxt 3 had dozens of packages available. Fetching? Axios. State Management? Pinia. Even the server engine could have used Express or Fastify like Nextjs do. By your logic, should Nuxt have done nothing? Should Nuxt stop all development now? Because there are a dozen packages for every single use case out there? No, the reason Nuxt 3 stand here today is because they did not stop innovating on things that have thousands of packages. Official packages are the things that set a frameworks apart. They ensure compatibility and long-term support for the individual, they unify and set standards and conventions for the whole community, and they leads streamlined enterprise support for big clients. An official package is something much more than "just another package". If you would say that the reason for the delay is, the Team is understaffed? Fair enough. Still havent figure out a perfect way to do it? Understandable. Need to wait on some other features to build on top of? Acceptable. But to say something akin to "we dont care because there are community packages" is just a huge punch to the guts to the whole community |
@Lumethys it's unfortunate that you missed the latest Nuxt's office hours because that question was brought up again (is often overall). 😅 Making a UI library based on other projects is clearly easier and more streamlined than building an all-in solution that covers 100% of the auth use-cases. So yes, Nuxt UI is there for a reason and to cover specific needs (a company just needs money at some point too). It is not similar to Vuetify/Quasar etc, because it uses a different approach. Any good framework maintainers know when to say no ❌, Svelte's ecosystem is a very good example to illustrate that. You cannot say yes to every proposition of the community and sometimes need to follow your own thoughts as to what the framework needs to become. PS: for fetching you should actually be using So yes, the core team might focus on things that might lead to bigger breakthroughs while the community can help solve other problems. Not every Nuxt module is made by the core team and that's what Nuxt aims to be. Also, I want to point out something based on my own experience of working on Vue projects.
Considering all of this, the Nuxt core team (besides the Now, the community will be totally fine helping you on a specific case you struggle with. All in all, the Nuxt team would gladly appreciate some feedback and improve the DX for auth. Also, you were talking about long-term support, conventions etc. I think that most of the time, the breaking change might just come from the 3rd party. Nuxt modules have no big wins in messing up how's auth done on the front end. To finish, I'd say that if people could clone themselves today, the core team would have already covered the auth topic (and a lot more) more in-depth. Until then, it's on the community to lead things forward. In an ideal world, the process would be:
Feel free to correct me if you feel like I am terribly wrong on some points @Lumethys. |
@kissu just to be clear, I'm not trying to force the team into out work themselves. It is true that the team can say yes or no to anything you like. Provided you have good reason to do so. And I think that communication of such matter should be more prevalence. It is ok if the team decide not to make an official Auth module, but there should be an announcement in that case. Quite a few of my company's clients still waiting on the Auth module to migrate from Nuxt 2. Some people I know also abandon their Auth module ideas. Because "in times the Nuxt team will have an official one, it is on their announcement". And i believe a good portion of the community is still holding off to this. I did not participate on Nuxt Office Hour. But is it ideal to have a Discord event be the only way of status update for the whole community? Why is it that whatever the latest new on Nuxt Office Hour did not make it on the official docs? While it is true that you cannot done everything the cummunity want, is it not better to have a one line announcement "Guys, due to understaffed and auth module is a huge undertaking, we are postponing this until 2025/2026" or something? |
@Lumethys if you expect this project to reach a v6 and support Nuxt3, it will probably never happen. Also, I am quite not sure why so many people still want that module to be upgraded to support Nuxt3. It did the job but wasn't fully perfect either and a lot of people were asking questions on it weekly on StackOverflow. That module had:
But nowadays, you can do pretty much the same with the resources linked above. Atinux is the co-creator of Nuxt. How do you want it to be more official regarding We have 200+ Nuxt modules as of today. The Vue ecosystem is big. People might be interested in other functionalities than the auth. I also do not see anytime soon a public conference announcement or anything as specific as an auth module. Also, regarding the roadmap, it is still planned. Might just be Atinux's project moved as the defacto go-to module (or any other one tbh). So, if have some clients with your companies you could do this:
I do not like making assumptions but I hardly see how the Auth module for Nuxt2 is not replaceable with a middleware + 3rd party composable (or a basic OAuth token). If your setup is complex, you could probably just get rid of the module anyway. This all in all just sounds like an invalid reason at this point. If you have some big needs for OAuth, you could pay for a service but for something basic, you could achieve that with vanilla JS (where we do not even need to do the backend side here). You unfortunately skipped 90% of my previous comment and did not allow us to help you. And here is my point: Nuxt Office Hours. I also know a good amount of folks who could just write a blog post for such a thing to help people like you (even tho, it probably already exists, eg: as shared in my previous comment). So no, the office hours are not meant for public announcement. Nuxt always had some issues regarding communication with the community, I am the first one to agree. Explaining your problem by putting the effort into a reproduction is also part of that open source help. This auth topic is so far totally unrelated. Here, you are not restrained from having Auth in your app today. I've heard that Daniel helped a person with some Auth issues last time. Almost all of those viable solutions are free, today. |
@kissu i think you misunderstood my comment. I was not asking for help for a specific problem with Auth for Nuxt 3. I was discussing the future of this Auth module and how the team was handling communication with the community. As this was originally an announcement on the topic. If I had some specific problem i would have sought help from the various communities and forums. I thank you for your various leads on personal help places should I need them. I surely will save them for later. But for now, I will focus on this instead.
And why was this not in the roadmap or the docs? I feel like this is such an important news to be "announced" in a reply to a random stranger like me?
Forgive me if this sound like sarcasm, but the official docs said so? Here is the full quote:
-taken directly from auth.nuxtjs.org main page This package's official document clearly states that the team is working on a new official module, and "meanwhile" - which i understood as "while waiting for us to finish this official module", the team recommend some other packages as temporary replacement. Is that not enough reason for the community, especially the clients who already utilize it, to wait and count on the team's own words? If that is not enough, even the official doc of nuxt framework: https://nuxt.com/docs/community/roadmap clearly state, under core modules: Both the official framework roadmap AND the package own roadmap, clearly promised the community an official auth module. Both of them are still labelled as "planning" so it is not the Utils package that released Is that not enough for the community to trust and look forward to? I am sorry if this sounds harsh, but after BOTH the Nuxt docs and this Module doc announced that the official auth package is coming. Even the Nuxt framework doc painted the picture as a "core module", an important module - "vital to the ecosystem" - words by words. Is it not a bit irresponsible to say "i dont know why people are expecting"? |
@Lumethys so...you're not happy because of the wording of this package?
I am not sure how we can be more explicit. So, you actually want a repo named You know axios right? It's nice for some GET and POST calls. If you have something complex, you already would have made your own "axios-style" kind of package. So...where is the issue? Because here, if you have some Auth using Then, should your whole company be stuck based on naming convention? Not be able to migrate and provide an actual service to your clients? Sounds extreme to me.
Why would it be? It's not important if the official module is this one or another one.
I don't see why this specific package ( You probably know some package that were named like EDIT: vue-draggable is a good example of it by having 2 differents versions: Vue.Draggable and vue.draggable.next. Is it a big deal? I don't think so. Most of the time, having radically different versions of a package adds more confusing than ease of use because people can misconfigure the thing + the issues would be targetted to 2 different versions.
Yeah, the core team is not blocking you from being able to auth your Nuxt 3 apps.
That's the whole point of being a developer, you will not come to your boss and tell him that you cannot have a login for your users so that unfortunately the company can just bankrupt because the damn Nuxt team just didn't ship their stuff. How is it important at the end of the day? I really don't get it.
The team probably thinks that they have not nailed down exactly what the official module should look like. Maybe I guess people just want to see So yes, if you would like to be that person who fully commits to asking questions, reporting back, and updating the documentation/repos/etc accordingly to move the thing forward, you can reach out to people. Would you rather have the team working on actual code and shipping things or fixing minor details? |
I'm just going to jump in here to lend support to @Lumethys point. I have been holding off upgrading a couple of projects to Nuxt 3 for various reasons, but the lack of clarity around auth was a significant roadblock. Because these Nuxt 2 projects used
I also read in the Nuxt 3 Roadmap that Auth was considered a "Core Module" but still in planning phase: I interpreted these statements to mean that the situation with Auth was still in flux, community options were available but that an official solution would eventually be provided. Are we now to understand that an auth module for Nuxt 3 is not going to happen? I can see how there may be valid arguments for making this decision. But if that is the decision, can the official channels please be updated to reflect this? |
I would bring up the same argument of asking if a wrapper for your use-case is maybe not possible too? 🥲 |
Of course there are many ways that I can implement an auth solution. The issue here is not about whether auth is possible or not. But if an official "nuxt way" for auth in Nuxt 3 will be provided (and assuming it meets my technical needs), I might prefer to use it rather than inventing my own. I'm not in any hurry to migrate to Nuxt 3 yet, I have significant projects on Nuxt 2 in production so I've waited for the ecosystem to stabilise before upgrading. Auth is now the last piece I'm waiting on but as long as this module was supposedly planned to be implemented, it suggested to me that I should continue to delay migrating until I could evaluate it. Otherwise I might spend time implementing my own auth solution unnecessarily, adding to what is already likely to be a lengthy migration process. Again, all I'm asking is if a decision has been made about the future of this module, it should be communicated in the documentation so users like myself can update our own decision making accordingly. edit: I do acknowledge that |
As stated above, If you're not in a hurry, you could just wait a few months I think. Otherwise, this might be a good starting point. I meanwhile understand the concerns of knowing if it's the proper Nuxt way. Mistakes can be made fast when dealing with SSR in general so a custom solution might be tricky to do well. 👌🏻 EDIT: I'll ask the crew for more details tomorrow on Discord! 🙏🏻 |
Well seems like we are not on the same page yet. I ask question on behalf the the community. It is not that I cannot find a solution should I need auth for my specific project. It is about how the vast majority of the awesome community feel in general. Let's just set aside the historical context of this module and its v5, v6 things. Let's just pretend that I am total new to Nuxt, I read the official nuxt.com roadmap and I see "official auth module to be announced", am I wrong to think "Hey, the team is going to have a Nuxt-way to do auth, let's wait for them"? It is not me as an individual, it is the concensus of the vast community to trust and wait for something that is on the nuxt.com official roadmap (again, not counting this package). Let's think in the PoV of an average Nuxt user. You said you would welcome PR to change the docs. But how can we know what to change? If I did not participate in this thread, no one in the community would know that v6 is never gonna happen. How am I - an random user, know what the team is planning and update the roadmap accordingly? You said that I should raise my question and/ or give suggestion at Nuxt Office Hour. Sure, as an individual who loves Nuxt, I would loved to. But what about the rest of the hundreds of thousands of Nuxt community member? Do they all need to join a Discord event to know a drastic change in the framework roadmap? Back to reality, to the future of Nuxt's (apparently unnamed) Auth module. What is the plan? 1/ No auth module ever, either we manually do it using the Utils, or use 3rd party packages 2/ A v6 of this package, made compatible with Nuxt 3 3/ A completely new Auth module, unrelated to this package I don't know exactly what role you have on the team, but you also did not know and have to ask other members. So how could I, or on that matter, an average Nuxt user, know? I think it is unrealistic to expect an average user to know it and submit PR to change the Docs on his own. When we all talking about the team's roadmap and internal planning. |
Thanks for the explanations on the current state of the module and alternatives. |
Reading recent messages, I understand that you are looking forward to a new official authentication solution for Nuxt 3 as it is the last item in the official roadmap for Nuxt 3. atinux/nuxt-auth-utils is the latest attempt from the Nuxt team to make a solution that fits with Nuxt 3's full-stack design and it is still under development progress. When we are confident enough to flag it as an official solution, we will update the official website as well 👍🏼 (in the meantime, I would suggest redirecting any feedback and contribution directly to atinux/nuxt-auth-utils repository to help move it forward faster 🙏🏼 (locking this thread because this repo's state is frozen to Nuxt 2 support only) |
Nuxt 3 support
Nuxt 3 comes with built-in utilities to support session and authentication. We are working on a new official module. Meanwhile, we recommend:
other solutions:
Idea of auth module started back into 2017 as a way to standardize API authorization flow with nuxt applications using store state (almost same time we introduced modules concept to nuxt it was one of examples). By the time passing usage of module and varieties went way further of what it was initially designed to be.
Having a provider agnostic auth module is a really complicated problem:
Simply saying there was no solution (with current design) to make every project happy
By each of last five major releases, we tried to adopt with new requirements and nuxt updates but still module is buggy because of complexities above and legacy code-base and almost impossible to accept new contributions without breaking changes -- one fix break another usage.
With v5 project and HUGE help of @JoaoPedroAS51 we started with a major typescript rewrite to improve architecture of module. Yet still there are framework requirements to complete v5 rewrite:
Considering current status, auth module is not a stable or well-documented solution but also it doesn't means project is forgotten. We are trying hard to fill in the gap for missing core components for v5.
Some alternative packages suggested to make your own auth solution:
Update: Status page added to docs https://auth.nuxtjs.org/status
Update: Thanks for all DMs for helping <3 Any help on docs is more than welcome via PRs
Regards and thanks for your patience 💚
The text was updated successfully, but these errors were encountered: