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

KP @kp

About: Building Platforms to empower people. My preferred Tech stack is in Laravel, Nuxt.js, Vuejs and TailWindCSS!

Location:
San Francisco
Joined:
Jun 17, 2019

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

Publish Date: Jul 19 '19
7 7

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.

Comments 7 total

  • Lili Z
    Lili ZJul 24, 2019

    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.

    • KP
      KPJul 24, 2019

      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 :)

      • Lili Z
        Lili ZJul 24, 2019

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

        • KP
          KPJul 24, 2019

          Thanks :) I guess time will tell! :)

      • Eke Enyinnaya Diala
        Eke Enyinnaya DialaAug 23, 2019

        Congrats! Inertia is now stable for use in production.

        twitter.com/reinink/status/1161356...

        The docs are still been worked on but if you subscribed to the mailing list you can see the new docs. If you didn't here it is: inertiajs-new.netlify.com

        PS: The website is not to be shared publicly yet. It is still in development.

        • KP
          KPAug 23, 2019

          Thanks, Inertia doesnt do SSR so I've settled on Nuxt and Laravel.

  • Eke Enyinnaya Diala
    Eke Enyinnaya DialaAug 23, 2019

    If you haven't already found a solution to this Nuxt has an auth module that provides a solution to this.

Add comment