mercredi 26 mai 2021

Custom api authentication in laravel

I am trying to make authentication based on api in laravel . Here is my process flow. First of all I get data from api . If it is valid then I keep true value in session . Through a middleware i check every route if it is authenticated or not. Am I in right track ?

Session::put('authenticated', true);
session::get('authenticated');

Should I add anything to make more efficient ? Here problem is I can not handle /login route. After successful login it can be visit login page. Also I can't get session value in LoginController function __construct() . Thanks in advance. I am using laravel 5.5



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire