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>
PHP中文网2017-05-16 13:10:25
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)?