nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.91k stars 926 forks source link

[Important] Auth Module State #893

Open pi0 opened 3 years ago

pi0 commented 3 years ago

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 πŸ’š

sgarner commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

@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 commented 3 months ago

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 commented 3 months ago

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)