mercredi 13 septembre 2017

Laravel 5/AngularJS custom authentication best practice

I'm working on an application using Laravel 5.3 as a back end and AngularJS as the front end. For authentication, the user's information needs to be matched against an external API. To do so, I've been using a custom version of Laravel's built-in authentication, i.e.,

  1. User enters information
  2. AngularJS front-end sends to Laravel back-end
  3. Laravel uses Auth::login to check against external API
  4. Either tell the user that their credentials are wrong or move them to the home page

My question is, from that point forward, is it bad practice to continue using Laravel's built-in auth middleware functionality to see if the user is authenticated when they move around the application?

Everything I'm reading seems to discuss using token based authentication (mostly JWT), and while my method definitely works, I'm new to AngularJS and would like to ensure that what I'm doing follows best practice.

Thank you!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire