Closed pedroscursel closed 4 years ago
I'm having the exact same issue.
Maybe someone else needs a possible solution. I had same issue. This issue was in login method in my AuthController.
Original code:
public function login(Request $request) {
$frd = $request->only(['email', 'password']);
$user = User::where('email', $frd['email'])->first();
if ($user) {
if (Hash::check($frd['password'], $user->password)) {
$token = $user->createToken('Laravel Password Grant Client')->accessToken;
$response = ['token' => $token];
return response($response, 200);
} else {
$response = "Password missmatch";
return response($response, 422);
}
} else {
$response = 'User does not exist';
return response($response, 422);
}
}
Corrected code:
...
$token = $user->createToken('Laravel Password Grant Client')->accessToken;
$response = ['token' => $token];
return response($response, 200)->header('Authorization', $token);
...
Closing due to inactivity.
Hello, I love how it works fine in vue-admin but when I start from scratch, using VUE UI it's won't work as well...
My /users endpoint (Laravel Lumen micro service):
My Vue Code:
package.json
router.js
main.js
App.vue
The Login File
I'm using vue-bootstrap markup on Login.vue file. It has some customisations for callbacks. I'm need to translate it because I'm Brazilian, but in general, it's works very well
views/Login.vue
views/Home.vue
It's my "index" page, won't need to be logged
views/Welcome.vue
and, this is my Welcome page. It's need to be logged to be seen
The end of the code, here is my components files. I won't share the asses files, like navbar and sidebar just for save this Issue request size.
components/index.js
My index.js just get the components and exports in one file
components/AppMain.vue
For finish it, some prints using the application
Thanks Websanova for your amazing work! After you help-me I will create an video for Brazilians explaining how to fix this issue. Regras from Brazil, Pedro