我有一些关于认证尝试失败的帖子,但我的情况似乎有所不同。仍处于开发阶段,所以我的密码是纯文本。我尝试登录,但我一直收到错误,因此重定向回登录页面。认证尝试失败Laravel 5.4
错误消息说用户名/密码不匹配,但dd显示电子邮件和密码都是正确的。
什么可能是造成这种故障的原因? PS:这是我第一次用laravel
web.php
Route::post('/login', '[email protected]');
Route::get('/', '[email protected]');
AuthController
public function auth()
{
//dd($request);
// attempt to login the user
if (! auth()->attempt(request(['email', 'password']))) {
return back()->withErrors([
'message' => 'Username/Password does not macth'
]);
}
return redirect('/');
}
PostController中
public function index()
{
$posts = Post::latest()->limit(3)->get();
return view('post.index', compact('posts'));
}
是您的密码保存在数据库中的哈希或可见? – dparoli
密码不被散列。这是纯文本 – Mena