1

I have Database created by Codeigniter included "users" table, the problem is "password" in this table hash by Codeigniter and I need to authenticate login using Laravel 4,

if (Auth::attempt(array('email' => $email, 'password' => $password)))
{
    return Redirect::intended('dashboard');
}

how to rewrite Auth::attempt to accept Codeigniter HASH?

thanks,

1 Answer 1

2

You have to use same hash function used in Codeigniter (it's sha1 by default), then you can login the user manually if the password matches, so instead of using Auth::attempt:

if($user = User::where('email', '=', $email)->where('password', '=', sha1($password))->first()){
    Auth::login($user);
    return Redirect::intended('dashboard');
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.