DEV Community

Cover image for How to setup nuxt-auth v6 authentication with the "credentials" provider on nuxt3 project

How to setup nuxt-auth v6 authentication with the "credentials" provider on nuxt3 project

Gerald on July 22, 2023

nuxt-auth is an open source Nuxt module that provides authentication for non-static Nuxt 3 applications. - sidebase The easiest way to get starte...
Collapse
 
axon profile image
Jeff Spurlock

Thanks for this. i found it right as i was about to give up because Sidebase and the nuxt-auth documentation is fucking terrible.

'how do you make a cake?'
sidebase: "oh, easy, you just combine the ingredients and bake it at the right temp."
'Uh... OK, mind telling me the ingredients and how long to bake it and at what temp?'
Sidebase: "hahahahaha, no fuck you."

Collapse
 
geraldmuvengei06 profile image
Gerald

Just read this 😂😂

Collapse
 
ochiengotieno304 profile image
Ochieng Otieno

lol - almost gave too

Collapse
 
oussamalkd profile image
Oussama Louelkadi

Thank you so much for your time.
This Article is clear enough and helped me to use auth module.

Collapse
 
geraldmuvengei06 profile image
Gerald

You're welcome!

Collapse
 
gold_collect_f4ea8cff451d profile image
gold collect

this code help me and I like this

Collapse
 
fabiovaz profile image
Fabio Vaz

Thank you!

and to implement authentication with Google instead of local, but in the same code pattern

Collapse
 
geraldmuvengei06 profile image
Gerald

I will to a complete Nuxt auth series. We can build a simple project while at it.

Collapse
 
geraldmuvengei06 profile image
Gerald

Nice suggestion. I'll write one for third party authentication

Collapse
 
chadere_nyore_0c3b8cdbccb profile image
Chadere Nyore

Hi, so I am stuck here, I get a successful login, but sidebase doesn't save the state, I need to signin after every reload. What could be the problem?

Collapse
 
jeppepepp profile image
JeppePepp

What about handling refresh tokens? Also can you show a example of how to in smart way use your cookie/jwt to make calls to a custom backend api?

Collapse
 
geraldmuvengei06 profile image
Gerald

I'm working on an all round nuxt app with all the auth cases