jeudi 19 septembre 2019

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
PHP 7.2
MySQL 5.7
Apache 2.4

returning always false even username and password are correct

{"status":"invalid email"}

Secondly, we ran same code, request parameter and database at our development server with specification bellow

Centos 7
PHP 7.3
MySQL 8
Apache 2.4

return always true indicate by redirect to another page

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.

What happened here? Does somebody has faced same issue as us?

thank you in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire