skip to Main Content

Due to limitation of internet connection in my area, I decided to not using the laravel/ui package.

My problem is that the Auth::attempt is not working properly. The hash keeps changing so the hashed password do not match. Help.

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

2

Answers


  1. use Hash;
    Hash::make($request->input(‘input’));

    Login or Signup to reply.
  2. First of all query to get user

    $user  = User::where('email' , $request->input('email') ) ->first();
    

    Then check hashed password with input password

    $password  = $request->input('password');
    if (!Hash::check($password, $user->password)) { 
        //login failed 
        // return proper message to user 
        // return back();
    }
    Auth::login($user);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search