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

Firemaps's avatar

5.3 Login problem

Hi all, I am migrating app to 5.3 and I am experiencing login problem. In my RegisterController I am sending the user a confirmation email token which is generated in the User __ construct. This works fine and verified changes to 1 however when I try to login I am still getting 'These credentials do not match our records' error.

Here is my AuthenticatedUsers trait:

    public function login(Request $request)
    {
        // $this->validateLogin($request);
        $this->validate($request, [
            'email' => 'required|email',
            'password' => 'required'
        ]);
        // attempt to login 
        if(Auth::attempt($this->getCredentials($request))) {
            // flash()->success('Welcome!', 'You may submit your photos here.');
            return redirect('/submit');
        }
        $this->incrementLoginAttempts($request);

        return $this->sendFailedLoginResponse($request);
    }

    protected function getCredentials(Request $request) {
        return [
            'email' => $request->input('email'),
            'password' => $request->input('password'),
            'verified' => true
        ];
    }

Can anyone tell me where I'm going wrong please? Thanks

0 likes
4 replies
Firemaps's avatar

In my web routes I am using Auth::routes();

and in login.blade.php I am using

The network request is throwing a 302 status error, not found

??

ejdelmonico's avatar

I believe the issue might be that its credentials in 5.3 and $this-> validateLogin($request) which returns user email and password. Check out AuthenticatesUsers.php.

Firemaps's avatar
Firemaps
OP
Best Answer
Level 11

Found it :

In my users controller I was using a mutator to set the pw

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

However I was already doing this in the RegisterController

    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'username' => $data['username'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
1 like
Firemaps's avatar

Final update:

I discovered this error as I was configuring 'change password' functionality for the user.

It made things much easier to remove the bcrypt from the Reg controller and from the change password functionality and keep everything in the Users setPasswordAttribute mutator

Now everything works fine :-)

Please or to participate in this conversation.