Strapi Authentication with Nuxt.js

This is a step-by-step guide on how to implement Strapi-based authentication in a Nuxt.js app.


This is a companion discussion topic for the original entry at https://strapi.io/blog/strapi-authentication-in-nuxt-js

Hello, first of all, thank you for this tutorial that allowed me to set up the beginning of something I wanted for a long time!

I’m a new developer on Nuxt.JS and Strapi, so I don’t know if it’s a misunderstanding on my part, or if it’s due to the version I’m using of Nuxt.JS (the one of now).

I have these 2 problems:

  1. When I create the middleware “Guest.js”, and I reuse the code of the tutorial on my “login” and “register” pages, I get a 500 error but without any information either in the console response or on my terminal.
  2. I added a “single media” avatar field that I called “picture” for the Users collection (authenticated), everything works, except when I try to display the media

Thanks in advance !

Can you guys accompanied this tutorial with a project repo?

Howdy, i’m trying to do exactly the same but with oauth discord authentication instead of the local strategy, how different would this be? I’m trying some stuff but it feels like swiss cheese so far.

Can this post be updated to Nuxt 3?

It would help if version numbers were mentioned in this tutorial.

This tutorial is based on Nuxt2. Meanwhile, the auth ecosystem in Nuxt3 is completely different.