How to implement Auth using Laravel & Nuxt.js (framework for Vue.js)

github logo Updated on ・1 min read

I am trying to implement Authentication for a Nuxtjs + Laravel app.
I would like my app to allow register + login with email and social (google, facebook, linkedin and twitter).

What is the best way to approach this? Should the auth happen in the back-end (Laravel) via Nuxt making API calls to the back-end? Are there other approaches? Pros and cons? Pointers to github repos are appreciated! I love to copy-and-paste :D

PS. Also I've heard about JWT but don't understand how it's any better than regular auth.

twitter logo DISCUSS (4)
markdown guide
 

Hi KP, as I see you don't have any responses still, the only help I have as of now is here: github.com/lilianaziolek/vue-full-...
The rest of this app is either not applicable to you (Java) or not how I'd do it now (knowing Nuxt better now - this was written over a year ago, when I was still very much a Vue/Nuxt newbie) - but perhaps it will give you something to start with.

 

Thanks @lilianaziolek I appreciate it! Very kind of you.
Btw I just discovered Inertia.js (which integrates Laravel and Vue into one repo, and it has the benefits of client-side rendering
reinink.ca/articles/introducing-in...
github.com/inertiajs/inertia-laravel
So I am toying with this for now. If I can simplify my stack by getting rid of Nuxt, while still having the benefits of client-side rendering, that might be a win. We'll see how it goes though, for all I know I may end up coming back to Nuxt :)

 

hmmm, never heard of Inertia.
Good luck and my gut feeling is you will come back to Nuxt indeed - but only time will show :)

Thanks :) I guess time will tell! :)

Classic DEV Post from Jan 7

GitHub Private Repos are Now Free

It comes with up to three collaborators per repo.

KP profile image
I do Web Development using Laravel, Vuejs and TailWindCSS