php - Laravel5.4中JWTAuth::attempt认证失败?
世界只因有你
世界只因有你 2017-05-16 13:08:25
0
1
480

在做laravel5.4中的jwt认证登录时,登录认证失败,注册认证成功.

调试代码时发现是JWTAuth::attempt($credentials)认证失败,值为false;
当我使用postman发送请求时是这样的
登录请求:


下面是我的配置文件

这是web.php文件

这是AuthController

这是MyUser (Model)

我觉得问题的根本就出在JWTAuth::attempt($credentials)

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

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!