Home > Software design >  Nuxt 3 User Authentication
Nuxt 3 User Authentication

Time:12-20

I am currently programming a Nuxt app for my company. My problem now is that this app requires user authentication with at least credentials. The best I've found is Auth0. But my problem is that I can't/may not use any external services that require an account. I currently have my own backend right in the Nuxt app for all data that works with Prisma as the ORM. I'm currently using Sidebase's Nuxt-Auth. But for me it's not the optimal choice because it doesn't really support 2FA for the credential provider and I can't have an error in the login form, for example (so, for example, if the password is wrong, it will be displayed under the input). What is the best way in my case? Here are my requirements.

  • Credential Auth with 2FA
  • No additional software I need to run (like supabase)
  • No external service

CodePudding user response:

You pretty much found the solution yourself already.

  1. The nuxt module is having too much abstraction, hence it's not flexible enough for your use case.
  2. Auth0 may be a better fit, especially if you use it as is (with just the JS part of it).
  3. Want even more flexibility? You will need to code something yourself, never served best than yourself.

Depending on your requirements, time, and knowledge, you may pick 1, 2, or 3 above.
No magic solution baked-in into Nuxt per se. It's also a JS meta-framework so you will likely have to manage the auth part via some network exchanges etc...in comparison to a Laravel, Ruby on Rails app for example.

  • Related