php - JWTAuth::attempt authentication failed in Laravel5.4?
世界只因有你
世界只因有你 2017-05-16 13:08:25
0
1
520

When doing jwt authentication login in laravel5.4, the login authentication fails, but the registration authentication succeeds.

When debugging the code, I found that JWTAuth::attempt($credentials) authentication failed, the value is false;
When I use postman to send a request, this is what it looks like
Log in Request:

< /p>


The following is my configuration file

This is the web.php file

This is AuthController

< /p>

This is MyUser (Model)

I think the root of the problem lies in JWTAuth::attempt($credentials)

< /p>

世界只因有你
世界只因有你

reply all(1)
Ty80

Now the problem has been solved.
The reason is that when my postman sends routes, I log in using UserBk(model), but the registration is MyUser(model). The account I use to log in is the account in MyUser, which leads to the problem. , JWTAuth failed. So I logged in with the UserBk account, and then logged in and registered.
What I still don’t understand now is that when I use MyUser, I define the use of MyUser (model) in jwt.php, then Why is my login still bound to UserBK(model)?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template