Skip to content
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

Open
pi0 opened this issue Dec 3, 2020 · 57 comments
Open

[Important] Auth Module State #893

pi0 opened this issue Dec 3, 2020 · 57 comments

Comments

@pi0
Copy link
Member

pi0 commented Dec 3, 2020

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:

  • Every auth provider has specific requirements and setup even when following standards like Oauth2
  • Non implicit authentication flows require a backend API to be also configured properly (like laravel or passport)
  • There is still no standard way to have universal state for nuxt applications
  • Isomorphic http requests require properly configured endpoints for server-side rendering and proxy
  • With static generated websites, we need to partially hydrate on client-side
  • Documentation area needs more attention for each provider

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:

  • Built-in support for API routes in Nuxt framework (WIP)
  • Standard way to handle sessions (@nuxt/session WIP)
  • Partially auth state hydration for SSGs

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 💚

@pi0 pi0 pinned this issue Dec 3, 2020
@pi0 pi0 changed the title Important: Auth State [Important] Auth Module State Dec 3, 2020
@bmulholland
Copy link
Contributor

bmulholland commented Dec 3, 2020

@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?

@pi0
Copy link
Member Author

pi0 commented Dec 3, 2020

@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.

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?

That's for sure! Please ping me on discord if interested to help for issue triage and maintenance :)

@kissu
Copy link

kissu commented Dec 4, 2020

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. ❤️
I have to admit that it's my first time w/ the authentication thing. It was hard understanding all the various setups and how it works. After a few blog posts + github issues, I achieved to make 2 implementations:

  • Auth0 basic flow of email/password
  • JWT w/ a custom backend given by my teammates

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 httpOnly + secure cookie thing and the why tho. I also get that people's use cases can be unique and complex.

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 ! 🙏🏻
Hope this project will continue and that you will get better. 👍🏻

@soaresdude
Copy link

Where can I find the documentation for the v4?

@Micka33
Copy link

Micka33 commented Dec 13, 2020

Where can I find the documentation for the v4?

Same question.

And if someone is interested:
plugins/api.ts

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

nuxt.config.js

{
  modules: [
    '@nuxtjs/auth-next'
  ],
  auth: {
     plugins: [ '@/plugins/api' ]
  }
}

$auth defined

nuxt.config.js

{
  modules: [
    '@nuxtjs/auth-next'
  ],
  auth: {
     plugins: [ '@/plugins/api.ts' ]
  }
}

@bmulholland
Copy link
Contributor

bmulholland commented Dec 15, 2020

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 :)

@soaresdude
Copy link

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.

@AllanPinheiroDeLima
Copy link

The old plugin docs were removed ? I'm trying to find them, but I didn't yet

Copy link
Collaborator

Hi @AllanPinheiroDeLima! You can find the docs of auth v4 here

@hardcommitoneself
Copy link

Hi. Does @nuxtjs/auth-next support nuxt 3 app?

@AllanPinheiroDeLima
Copy link

@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

@hardcommitoneself
Copy link

Thanks, @AllanPinheiroDeLima. The following is my problem when I run build.
image
Please check out and let me know what a problem.

Many thansk!

@AllanPinheiroDeLima
Copy link

@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?

@hardcommitoneself
Copy link

Before I add '@nuxtjs/auth-next' in nuxt.config.ts, it is working well. But after added, the error occurs.

@AllanPinheiroDeLima
Copy link

@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 if you're not willing to test disabling them, there is a good chance that they will not work. Well, to be completely honest, there is a chance that they will not work either way, since Nuxt3 changed so many things alongside Vue3.
If it does not work, you'll have to decide which is better: leaving this module behind and doing authentication yourself, looking for another auth plugin or downgrading your project to Vue2/Nuxt2 or Vue2/Nuxt-Bridge

@Vinccool96
Copy link

So, what is happening with the official Auth Module?

@kissu
Copy link

kissu commented Sep 6, 2023

@Vinccool96 still in the works if I'm not mistaken. 😊

@Vinccool96
Copy link

Is there a repo where we could help?

@harlan-zw
Copy link
Contributor

harlan-zw commented Sep 17, 2023

If anyone is looking at this thread and wondering what to use for Nuxt 3 auth :

Implement your own auth using something like Lucia

Thanks, I updated the readme and the main comment with these.

cc: @pilcrowOnPaper, is this the best link for Nuxt users?

@pilcrowOnPaper
Copy link

@AlejandroAkbal
Copy link

Not to be snarky, but it's 2024 and we don't have an official auth for Nuxt 3

@kissu
Copy link

kissu commented Jan 10, 2024

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.
The team is focused on other things right now that are more prio than slightly improving the auth part.

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? 🤗

@AlejandroAkbal
Copy link

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. The team is focused on other things right now that are more prio than slightly improving the auth part.

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

@pi0
Copy link
Member Author

pi0 commented Jan 10, 2024

Please checkout nuxt-auth-utils from @Atinux. It is the latest effort for stable auth support.

@kissu
Copy link

kissu commented Jan 10, 2024

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).
Not sure about the stability of the other solutions but feel free to raise an issue with the concerned ones to maybe find a solution. I know that quite some people are reactive for proper troubleshooting! 👌🏻

As stated in the comment above, Sébastien did a lot of working examples so you could maybe find a solution there. 😋
Auth was always a bit difficult to setup in place given a set of constraints anyway, even with Nuxt2. That's why reporting those can improve the whole ecosystem towards something working really well. 😄

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.

@samturrell
Copy link

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.

@kissu
Copy link

kissu commented Jan 10, 2024

@samturrell maybe come to the Nuxt Discord call this evening to discuss that one further (if you can!). 🤗
https://discord.gg/F77zGBtx?event=1184555281871540265

@AlejandroAkbal
Copy link

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). Not sure about the stability of the other solutions but feel free to raise an issue with the concerned ones to maybe find a solution. I know that quite some people are reactive for proper troubleshooting! 👌🏻

As stated in the comment above, Sébastien did a lot of working examples so you could maybe find a solution there. 😋 Auth was always a bit difficult to setup in place given a set of constraints anyway, even with Nuxt2. That's why reporting those can improve the whole ecosystem towards something working really well. 😄

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.

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

@kissu
Copy link

kissu commented Jan 10, 2024

@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.

Copy link
Member

Atinux commented Jan 11, 2024

@AlejandroAkbal if you use a backend for Auth like Gumroad, all you have to do is to store the JWT in a cookie using useCookie() for example

@prodoxx
Copy link

prodoxx commented Jan 24, 2024

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.

@Lumethys
Copy link

Lumethys commented Mar 10, 2024

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. The team is focused on other things right now that are more prio than slightly improving the auth part.

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

@kissu
Copy link

kissu commented Mar 10, 2024

@Lumethys it's unfortunate that you missed the latest Nuxt's office hours because that question was brought up again (is often overall). 😅
The nuxt-auth-utils listed above is done by Atinux, hence quite an official package by the Nuxt team. 💚

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.
Nuxt 2 did not had an official Nuxt UI probably because of the human resources at that time. People working at NuxtLabs might just have been focused on something "more important".

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 $fetch nowadays, because it's more universal and can be plugged into any kind of tool. Pretty much the philosophy of UnJS.
This is why the team didn't rely on Express or Fastify, the end goal is not the same, as the foundations.

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.
Any open-source project that does not facilitate collaboration is pretty much aimed to die without any contribution.

Also, I want to point out something based on my own experience of working on Vue projects.

  • If you're a beginner and starting something, your needs might be simple, and relying on something as simple as using Supabase/Auth0/other and needing to have a middleware to check if you are actually authenticated. Something that depends on the 3rd party service used and can be paired with any VueUse composable. I am pretty sure that @Baroshem's blog post can be a good start. You can pretty much solve the problem by yourself with the things available today. Not the case? Reach out to people to get help.
  • If you're senior and working in a big company, you will likely have some very specific constraints and challenges to solve. How will it be solved? You and your team will have an internal solution that will check all your niche needs.
  • If you're in the middle, and need something a bit in the middle that would solve the issue easily, you might need a package for that purpose. Based on all the solutions available above, I think that you could reach out to the people directly or post an issue on their repo's issues page.

Considering all of this, the Nuxt core team (besides the nuxt-auth-utils project mentioned above) did not find a way to add any more value than people working on it full-time already, like @pilcrowOnPaper.
What would be the added value of working on something on which people are already daily? Get something better by 3%? You can guess that it's not worth the time/effort to have some competition on something as broad and case-specific as auth.

Now, the community will be totally fine helping you on a specific case you struggle with.
If you want to help push the whole idea forward, please come up with some reproduction of a problem you face. That way, the community will be able to help you with it.
If enough people do that, then at some point the people working on auth (or even the core team) could narrow down the issues and have something truly bullet-proof. Folks like @danielroe or @manniL would gladly highlight how to solve those issues with a blogpost/video or any kind of relevant media format.

All in all, the Nuxt team would gladly appreciate some feedback and improve the DX for auth.
Please be mindful of providing a precise example of what's lacking nowadays.
Any maintainer here is ready to get that sort of feedback, it being on Discord, Twitter, Github issues/discussions, or else.
Please also understand that sometimes companies need to have a mix between what's good for the company + what's good for the community.

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.
By community, I mean you, me, or any other developer using Nuxt daily.
Doing that extra effort is time-consuming, hard, and might be difficult to explain for sure.
But you cannot blame the hard work provided by the team already. ❤️‍🩹

In an ideal world, the process would be:

  • facing an issue that brings frustration and blocks your work
  • reaching out to the community to have it fixed (asking for help is hard, I suffer from it too 😓)
  • getting your problem solved or having a workaround at least
  • ship 🚀 some educational blog post, some docs PR, a StackOverflow self-answer etc...or any kind of highlights for future developers facing the same issue
  • improve the framework forward with your contribution 💚

Feel free to correct me if you feel like I am terribly wrong on some points @Lumethys.
I am mostly trying to understand your POV and help people like you.

@Lumethys
Copy link

@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?

@kissu
Copy link

kissu commented Mar 10, 2024

@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:

  • some baked-in middleware that would limit access to some pages
  • some OAuth for basic JWT tokens
  • some providers like Github, Google, etc...

But nowadays, you can do pretty much the same with the resources linked above.
The Nuxt team shipped those tools already. Maybe the different name is making it a bit more confusing?
Tbh, Atinux's project might just get renamed to something like @nuxt/auth in the future. That will still not be fully backward compatible with the old codebase: don't expect a simple package bump to fix any incompatibilities.

Atinux is the co-creator of Nuxt. How do you want it to be more official regarding nuxt-auth-utils?
Do we need to have official in the name?

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:

  • try to have a spec sheet with all the things needed for your clients
  • find the auth project that suits your needs the best from the resources above
  • abstract your client's projects code into a common function/composable or even your own NPM package
  • enjoy your life for the next 3+ years because frontend auth doesn't move much in JS realm

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).
Now, you have whole projects to help you with that + the whole Composition API through VueUse's help, sounds achievable.

You unfortunately skipped 90% of my previous comment and did not allow us to help you.
If you struggle with something we can help, but please help us help you.
This meanwhile requires some effort from your side, for sure. It's easier to just complain.

And here is my point: Nuxt Office Hours.
A meeting that you can join, ask some stuff in real-time, and get an official answer from the core team.
Even tho, it will be pretty much the same as mine. Maybe more polite or better phrased.
This will be a step forward in understanding the when/what/how of things.
If it's code-related, people in the community are also ready to help just post it in Discord/GH issues with a good reproduction.

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).
You're asking for an Auth solution, it doesn't need to fundamentally be using the old module. Just share what you struggle with to have some help.

So no, the office hours are not meant for public announcement.
Just a chill time with the team and maybe some questions to help you move forward.
Nothing would need to be updated in the docs. Even if this was the case, you can open a PR if you feel like something is off as of today.


Nuxt always had some issues regarding communication with the community, I am the first one to agree.
Meanwhile, quite some people are nowadays trying their best to push the project forward with some daily efforts to explain/educate and help developers succeed.

Explaining your problem by putting the effort into a reproduction is also part of that open source help.
You can be part of it. This is how open source contributors start usually: by facing some issues with the tool they use.


This auth topic is so far totally unrelated. Here, you are not restrained from having Auth in your app today.
You do not need to rely on the team to allow you to do so. It is already there.

I've heard that Daniel helped a person with some Auth issues last time.
Alexander is working his booty off to ship some advanced content on Nuxt on his YT channel, just ask him.
I noticed that there is a course on OAuth on the VueSchool side.
There are plenty of free blog posts available online.
Plenty of people could grant you some of their time to you it being on Github, StackOverlow, Discord.

Almost all of those viable solutions are free, today.

@Lumethys
Copy link

Lumethys commented Mar 10, 2024

@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.

If you expect this project to have a v6 and support Nuxt 3, that will probably never happen

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?

I am not sure why so many people still want that module to support Nuxt 3

Forgive me if this sound like sarcasm, but the official docs said so? Here is the full quote:

Nuxt 3 comes with built-in utilities to support session and authentication. We are working on a new official module. Meanwhile, we recommend [...]

-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:

Screenshot_20240311-004829_Chrome_1.jpg

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"?

@kissu
Copy link

kissu commented Mar 10, 2024

@Lumethys so...you're not happy because of the wording of this package?
Changing the README.md would be a quick fix to add nuxt-auth-utils!
This repo's description is

Zero-boilerplate authentication support for Nuxt 2!

I am not sure how we can be more explicit.
There is no point in touching this one and confusing people as to what is working with Nuxt 2 or 3. Even tho, this is mostly details at this point and organization of repos.

So, you actually want a repo named official-nuxt-auth-utils!
Why is that even a big deal? It's just the looks of a box at the end of the day, doesn't matter.

You know axios right? It's nice for some GET and POST calls.
Well, in your codebase you could abstract it with a file named makeApiCall.js and call it with await makeApiCall.get(...), right? Then, if tomorrow you change axios by ofetch, would it be a big deal?
No, not really. Because you would likely call await makeApiCall.get(...) the same way, after some internal changes to the wrapper file. Just a matter of small changes/syntax.

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 auth-module or nuxt-auth-utils, it will still mostly be the same result if you abstract it: checking if you have your token valid, connecting to a provider etc etc...

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.
Just wrap your Nuxt3 apps with the project that suits your needs and replace it if a new official comes in one day. Because again, nuxt-auth-utils might just be the official one.

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?

Why would it be? It's not important if the official module is this one or another one.

Forgive me if this sound like sarcasm, but the official docs said so?

I don't see why this specific package (auth-module) needs to support Nuxt3.
If it's a big rewrite and something totally new, people are likely to migrate.

You probably know some package that were named like vue-datepicker and nowadays we might have vue3-datepicker (this is an example), is it a big deal that the package is not a major version of the package.

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.
Having something like nuxt-auth and nuxt3-auth or whatever the names are, is a good and healthy separation.
It's on you to abstract them and keep the functionality in your codebase for your clients.

which i understood as "while waiting for us to finish this official module", the team recommended some other packages as a temporary replacement.

Yeah, the core team is not blocking you from being able to auth your Nuxt 3 apps.

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?

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.
You find a workaround and work with it until there is maybe something better. Oh wait, the Nuxt team just provided you with that exact workaround.
So, you abstract the auth functionality and use the workaround. Tomorrow, if there is an official nuxt3-auth coming, you replace your package with that one. If it is just a version bump on nuxt-auth-utils, then you bump the version and enjoy that dear official package.

How is it important at the end of the day? I really don't get it.
The nuxt-auth-utils package is well written by Atinux, not malicious, functional, and will not be deprecated or totally useless in 2 weeks. If there is a migration, it should not be too much of a pain because there are only so many ways to do authentication.

Both the official framework roadmap AND the package own roadmap, clearly promised the community an official auth module.

The team probably thinks that they have not nailed down exactly what the official module should look like. Maybe nuxt-auth-utils is close enough, I have not asked Atinux personally.
If you are that bothered by this one, please join us during the next Office Hours or open a PR with some of the resources down this issue rather than what's written on the roadmap page.

I guess people just want to see nuxt-auth-utils written down white on blue on the roadmap page to be happy?
Is that it? Like "where currently working on nuxt-auth-utils, it's a work in progress official auth module"?
It's not officially written down on the roadmap page, but here.
Does that make a huge difference considering this is the first issue that you see on this repo? Details IMO.
So yes people could spend countless hours trying to fix minor details like those but I guess that not enough people have the time for it. Also, it's pretty easy to find the workarounds. Worth it? If it is for you, submit a PR to fix the roadmap.

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?

@sgarner
Copy link
Contributor

sgarner commented Mar 10, 2024

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 @nuxtjs/auth, I read what that module's website says about Nuxt 3 support, which is the same as pi0's statement at the top of this issue:

Nuxt 3 comes with built-in utilities to support session and authentication. We are working on a new official module.

I also read in the Nuxt 3 Roadmap that Auth was considered a "Core Module" but still in planning phase:

image

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?

@kissu
Copy link

kissu commented Mar 10, 2024

I would bring up the same argument of asking if a wrapper for your use-case is maybe not possible too? 🥲
Until the team finally figures out a definite answer.

@sgarner
Copy link
Contributor

sgarner commented Mar 10, 2024

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 nuxt-auth-utils looks like it has most of the key functionality covered. If the decision is that nuxt-auth-utils is the official solution moving forward, that could be completely acceptable. But the docs should be updated to say so or we're left with uncertainty.

@kissu
Copy link

kissu commented Mar 10, 2024

As stated above, nuxt-auth-utils is the latest project on auth written by Atinux. It might just be the final solution, if not a good starting point as a whole. The main question is to know if it would be the official one or not.

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 guess I'll ask the team for some more definitive questions and update the roadmap on the next Nuxt Office hours.

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! 🙏🏻

@Lumethys
Copy link

Lumethys commented Mar 11, 2024

@kissu

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.

@mbergen
Copy link

mbergen commented Mar 11, 2024

Thanks for the explanations on the current state of the module and alternatives.
I read that the candidate nuxt-auth-utils does not support nuxt generate, is there any alternative that does?
The ones mentioned in this thread did not last time i check.

@pi0
Copy link
Member Author

pi0 commented Mar 11, 2024

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, nuxt-auth-utils is being internally used and tested in several production projects)

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-community nuxt-community locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests