I have some post about auth attempt failure but my case seems to be different. Still in dev phase so my password is in plain text. I try to login but i keep getting false and so redirected back to login page. dd reveals that both email and password are correct. What could be responsible for this failure? PS: it's my first time working with laravel
web.php
Route::post('/login', 'AuthController@authenticate');
Route::get('/', 'PostController@index');
AuthController
public function authenticate()
{
//dd($request);
// attempt to login the user
if (! auth()->attempt(request(['email', 'password']))) {
return back();
}
return redirect('/');
}
PostController
public function index()
{
$posts = Post::latest()->limit(3)->get();
return view('post.index', compact('posts'));
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lK3Q2E
via IFTTT
Aucun commentaire:
Enregistrer un commentaire