Laravel 5 Auth: These credentials do not match our records

phplaravelrecordsmatchnotcredentials5authadldap2

Last Update : 2023-09-22 UTC 09:21:31 AM

Answers of > Laravel 5 Auth: These credentials do not match our records

These credentials do not match our records., w3coded match credentials w3coded match credentials w3coded match credentials Meta Stack Overflow w3coded match credentials ,Stack Overflow en español,Stack w3coded match credentials Overflow em Português

I had the same issue. The reason for mine was that I defined setPasswordAttribute in my User model so every time, I enter plain password, it hashes before sending to DB.

public function setPasswordAttribute($password)
{
    $this->attributes['password'] = \Hash::make($password);
}

In addition to @mervasdayi solution, a good way to hash passwords in setPasswordAttribute avoiding rehashing problems could be this:

public function setPasswordAttribute($password){
    $this->attributes['password'] = Hash::needsRehash($password) ? Hash::make($password) : $password;
}

Further to what @mervasdayi & Gerard Reches have suggested. Just thought I'd make a note that you will need to include

use Illuminate\Support\Facades\Hash;

I think that it is later but i found two solutions to solve this problem. Firstly you can use bcrypt function if you use laravel 5.3. Look at the below function. It means that your get your data in array.

public function create(array $data)
{
    return User::create([
        'password' => bcrypt($data['password']),
    ]);
}

Secondly you can use mutator to fix it like this:

 public function setPasswordAttribute($password)
{
    $this->attributes['password'] = \Hash::make($password);
}

Current topics : Laravel 5 Auth: These credentials do not match our records

Newly Added Questions

Similar Questions

Questions :

How To Group Array Key Value

Last Update : 2023-09-22 UTC 13:24:58 PM

Questions :

PhpStorm Warning For React Attributes In Jsx File With SCSS File

Last Update : 2023-09-22 UTC 13:24:40 PM

Questions :

Why Is The File Not Showing Up In Request.files And In Request.forms Instead?

Last Update : 2023-09-22 UTC 13:24:20 PM

Questions :

Proxying Assets From React App Directory In Slim Framework?

Last Update : 2023-09-22 UTC 13:24:03 PM

Questions :

Laravel 5.4 Can't Run “php Artisan Preset React” Comand

Last Update : 2023-09-22 UTC 13:23:54 PM

Questions :

How To Update Session Values Without Signing Out?

Last Update : 2023-09-22 UTC 13:23:43 PM

Questions :

Array Is Not Visible

Last Update : 2023-09-22 UTC 13:23:37 PM

Questions :

React Routing For Login Using Symfony

Last Update : 2023-09-22 UTC 13:23:18 PM

Questions :

Sanctum With React SPA Returning 419 Page Expired

Last Update : 2023-09-22 UTC 13:23:03 PM

Questions :

How Do I Import An Input String Into Another Page

Last Update : 2023-09-22 UTC 13:22:44 PM

Top
© 2023 W3CODED - All Rights Reserved.