Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

adityakunhare's avatar

The provided credentials do not match our records.

I have an manual authentication in an Inertia app. Below is the Login method

 public function login(Request $request)
    {
        $credentials = $request->validate([
            'email' => ['required', 'email'],
            'password' => ['required'],
        ]);
        // dd($credentials);  // working fine till here and credentials are correct as per from frontend
        if (Auth::attempt($credentials)) {
            $request->session()->regenerate();
            return redirect('/users');
        }
        return back()->withErrors([
            'email' => 'The provided credentials do not match our records.',
        ]);
    }

The data was populated from User seeder below is the User factory I have been using

public function definition()
    {
        return [
            'name' => $this->faker->name(),
            'email' => $this->faker->unique()->safeEmail(),
            'organization' => $this->faker->company(),
            'phone' => $this->faker->phoneNumber(),
            'description' => $this->faker->text(),
            'email_verified_at' => now(),
            // 'password' => 'yIXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
            'password' => Hash::make('password'), // password
            'remember_token' => Str::random(10),
        ];
    }

Please let me know what could be the problem?

0 likes
6 replies
tykus's avatar

What is this yIXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi - that is not a bcrypt Hash (they begin $2y$ as their identifier?

adityakunhare's avatar

@tykus I think it is ignored in code block or something I have this in my code 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password

adityakunhare's avatar

tried with

Hash::make('password');

and with

bcrypt('password');

getting the same result "credentials does not match with our records"

tykus's avatar
tykus
Best Answer
Level 104

@adityakunhare do you have a mutator in your User model that is also hashes the password attribute?

1 like
furqanDev's avatar

Check if you have password Mutator in your User Model.

public function setPasswordAttribute($value)
{
     $this->attributes['password'] = bcrpt($value);
}

If you have this then either remove this or don't hash the password in the factory. Just pass a simple string.

1 like

Please or to participate in this conversation.