我正在使用 laravel/fortify 并尝试使用 HTTP 客户端请求进行身份验证
public function boot()
{
Fortify::loginView(function () {
return view('auth.login');
});
Fortify::authenticateUsing(function (Request $request) {
$response = Http::withHeaders([
'content-type' => 'application/json',
'Accept' =>'application/json',
])->post('http://127.0.0.1:8001/v1/login', [
'email' => $request->email,
'password' => $request->password
]);
if($response->ok()) {
//Session::put('token',$response['access_token']);
$data = $response->json();
return $data;
}
});
但我收到错误,错误是:
TypeError
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of
Illuminate\Contracts\Auth\Authenticatable, array given, called in
home/suraj/Documents/locaxapp/client/locux/source/clients/vendor/laravel/fortify/src/
Actions/AttemptToAuthenticate.php on line 77