foldTree f a (Leaf x) = f x a
foldTree f a (Node left right) = foldTree f (foldTree f a left) right
我正在尝试使用laravel public function action(Request $request){
$username = $request->username;
$pass = bcrypt($request->password);
$credentials = [
'id' => $username,
'password' => $pass
];
dd(Auth::attempt($credentials));
if (Auth::attempt(['id' => $username, 'password' => $pass])) {
echo 'Ok';
}else{
echo 'Not ok';
}
进行登录操作,但它始终返回auth::attempt
。
答案 0 :(得分:3)
$pass = bcrypt($request->password);
应该是
$pass = $request->password;
attempt
方法将自动处理加密和比较。您实际上已将其加密两次,因此未找到匹配项