简体   繁体   English

PHP Laravel 5.8 Auth Attempt 在 PHP 72 中始终返回 false

[英]PHP Laravel 5.8 Auth Attempt always return false in PHP 72

Running the same code, request parameter and database on different machine specification resulting different behavior.在不同的机器规格上运行相同的代码、请求参数和数据库会导致不同的行为。

First one we ran on our sandbox server with specification bellow第一个我们在沙箱服务器上运行,规范如下

Centos 7 Centos 7
PHP 7.2 PHP 7.2
MySQL 5.7 MySQL 5.7
Apache 2.4 Apache 2.4

returning always false even username and password are correct即使用户名和密码正确,也总是返回 false

{"status":"invalid email"}

Secondly, we ran same code, request parameter and database at our development server with specification bellow其次,我们在开发服务器上运行相同的代码、请求参数和数据库,规范如下

Centos 7 Centos 7
PHP 7.3 PHP 7.3
MySQL 8 MySQL 8
Apache 2.4 Apache 2.4

return always true indicate by redirect to another page始终返回 true 指示通过重定向到另一个页面

Check our code bellow.检查我们的代码如下。

public function login(Request $request){

    if(Auth::attempt(['email' => $request->email, 'password' => $request->password])){

        return redirect()->to('/location');
    }

It should be a simple and clean code.它应该是一个简单而干净的代码。 After digging on Internet, some article suggested using bcrypt so we have trying that solution and against, we got a different result.在互联网上挖掘后,一些文章建议使用bcrypt ,所以我们尝试了该解决方案,但我们得到了不同的结果。

What happened here?这里发生了什么? Does somebody has faced same issue as us?有人遇到过和我们一样的问题吗?

thank you in advance.先感谢您。

please check, if you have same records in sandbox database or not.请检查您在沙盒数据库中是否有相同的记录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM