Auth-module: I feel like really stupid

Created on 11 Nov 2020  路  6Comments  路  Source: nuxt-community/auth-module

I spent a few last days trying to make auth module work. And I failed.

I googled for many hours how to make a simple (as I thought) thing: nuxt with auth providing Google oAuth2 login and setting jwt token on success.

What went wrong:

  • no working examples for that case in auth repo/wiki
  • the google auth example works in the wrong way - the user gets authorized without sending a server-side verification request to google.
  • auth module skips request to the backend for no reason randomly when I tried to use examples from stackoverflow due no version was mentioned and different config syntax
  • it took some time to figure out why many developers use config syntax that differs from the documentation.
  • two documentations for the same v4: https://auth.nuxtjs.org/ and https://dev.auth.nuxtjs.org/
  • lots of examples use v5 when it is unstable and is risky to use in production so have no practical value

OK, just give up. I'm stupid. Auth module is about to reach its 5 version. Google has millions of pages mentioning nuxt and auth, its simplicity and how its so great. Developers use it and looks like they are happy. And I'm just not one of them.

I'll do a classic /auth/google server-only location to do all that server-side. I'll try to use auth module only for jwt token. If I'll make work somehow.

Thanks.

Most helpful comment

I'm sure everyone is busy and has other priorities, and that's fine, but this project really needs some maintainer love.

All 6 comments

I'm sure everyone is busy and has other priorities, and that's fine, but this project really needs some maintainer love.

@pi0 @JoaoPedroAS51 Do you need help maintaining this?

I would love to ship in! Is there some documentation on what has to be done for v5?

Hello.
I was struggling with axios & auth 4.x for several days implementing JWT with refresh token using NuxtJS (spa mode)/axios/auth... Finally, I identified my problems:

  • Using a mix of this.$axios and axios... That's why most of my requests had a strange behaviours with auth.

* I read all the doc available on Internet...i didn't saw the dev-auth documentation was for the v5 which work with refresh token & local scheme...(i used the last 4x. version).

The dev-auth website is really nice.... BUT can lead to mistake. Maybe :

  • a banner on the top off all pages which explain the web site is a 'work in progress' for the next auth version could avoid to this situation :)...
  • Also, on the dev-auth website, remove the 4.x.x version on the top-right, replace it with a 5.xx

By the way: A big thank you for this plugin..It works great when all parts are correctly assembled !! (even more: dev-auth 5.0 with Refresh scheme works with LoopBack 4.0).

Maybe, some warning/assert or debug mode should be added. I had to do some reverse to understand why it didn't work at the first try. When migrating from 4.x to 5.x from local to Refresh scheme : some data/property where incorrectly configured or missing from server.

True that it took me some time to understand how this one is working but then, it's cool to use (implemented homemade JWT from a backend + Auth0 as a test).
Your use case just should not differ to much from the magic configuration given to you.

Hi @igordata. Thanks for reaching out and mentioning this. I have tried to explain history of module and current status in #893. Still apologizes for inconveniences for module usage and lack of docs.

Any help on documentation is of course more than welcome (please ping me/framework team on discord)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DiegoGallegos4 picture DiegoGallegos4  路  3Comments

yuwacker picture yuwacker  路  3Comments

dasisyouyu picture dasisyouyu  路  3Comments

javialon26 picture javialon26  路  3Comments

AhmedAtef07 picture AhmedAtef07  路  3Comments