I have a project structure like client folder and server folder. Within client folder I have full Vue 2 project template using vue-admin-lte. Front end is working perfectly but where I am stuck is I need to authenticate each and every request to pass to server folder(running Laravel 5.5). Basically, how to compare and validate the access_token parameter sent from the frontend against the access_token present for each and every route.
Asked
Active
Viewed 696 times
1
-
1Have you considered using [Laravel Passport](https://laravel.com/docs/5.5/passport)? It has built-in support for what you’re trying to accomplish. – tptcat Oct 15 '17 at 13:28
1 Answers
1
The approach you are currently using (from what little information you have given) is not a good approach. Try and use json web tokens(jwt) insted.
For info about jwt.. https://jwt.io/introduction/
To implement jwt in laravel try one of the following two packages
https://github.com/tymondesigns/jwt-auth
https://github.com/codecasts/laravel-jwt
The first one (jwt-auth) is a large package with customization options while second one (laravel-jwt) is very simple but cannot be customized

Ragas
- 3,005
- 6
- 25
- 42