My registration form is working and it store users to db but when user login then Auth::attempt() return false. Here is my code for login. I store the password in db in sha1 encription.
Route::post('login',function(){
$creds=array(
'email' => Input::get('email'),
'password' => sha1(Input::get('password'))
);
$auth = Auth::attempt($creds);
dd($auth);
I solved it by converting the registering user password to sha1 and then to laravel hashing encryption like so
Hash::make(sha1(Input::get('password')));
At login time I do like below
Then
$auth = Auth::attempt($creds);
worked.Even though you can implement a Service provider as describe in this post, You can do it manually by with using other auth method
The best thing however is to use the
bcrypt()
in Laravel but the above should work in case bcrypt is no option.Try this -
Hope this will work for you.