samedi 30 mars 2019

How to guard API route using JWT laravel?

How to disable execute API requests if there is no token JWT?

No I have simple route:

Route::post('visitors/check', 'VisitorController@check');

And this code in controller VisitorController:

echo  JWTAuth::user()->id;

It fails down cause there is no token. How to handle this using JWT?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire