Sep 29, 2019
2
Level 2
Sending an Auth response to Vue using Lumen
I'm building a Vue app which is a dynamic menu. Which means the admin can add products to the menu, and those products will be shown on a card component. Because i need to have restricted pages for the admin to add products, i'm using Lumen from Laravel, to have a simple crud api. Although the problem in my situation is: How to handle Authentication through Vue and Lumen
I already read the docs but couldn't figure out how to imply that kind of code in my Vue project.
$app->get('/post/{id}', ['middleware' => 'auth', function (Request $request, $id) {
$user = Auth::user();
$user = $request->user();
}]);
I want to know what the best way is to send a response from Lumen to Vue that lets Vue know that the admin has logged in and can acces for example '/dashboard'
Please or to participate in this conversation.