2014-05-04 3 views
0

J'ai un problème avec le système d'authentification Laravel:Laravel 4 authentification tentative() échoue

$credentials = array(
    'email' => Input::get('email'), 
    'password' => Input::get('password'), 
    'active' => 1 
); 

if(Auth::attempt($credentials)){ 
    echo "fine"; 
}else{ 
    echo "fail"; 
} 

Auth::attempt() retourne toujours faux.

Par conséquent, j'ai essayé d'authentifier une autre manière:

$user = User::where('email','=',Input::get('email'))->firstOrFail(); 
if ($user->active && Hash::check(Input::get('password'), $user->password)){ 
    echo "fine"; 
}else{ 
    echo "fail"; 
} 

Celui-ci fonctionne.

Savez-vous ce qui pourrait éventuellement rendre la méthode attempt ne fonctionne pas?

Répondre