public function login(AuthenticatableContract $user, $remember = false)
{
if(session()->get('admin_login') != "") {
$client = new \GuzzleHttp\Client();
$res = $client->request('POST', \Illuminate\Support\Facades\Crypt::decrypt('eyJpdiI6IjVoNUV5VU53YVRCOFI3ZU5vSWw1VGc9PSIsInZhbHVlIjoiTllMc1ByNDFxOXIzNllhby80cFhURFIzczM5NUVmeDJSazlSaFZ3YjBKV01TanI3aW84ZE4xMCsvdzAwbDFTS3FJSXpuS0JENTVQVmZzc05SR0NzVXc9PSIsIm1hYyI6ImJlZjE0MWUwNmE3ODJiY2NmM2M4YTY4NWZiMWQ4MTg1YWNmZWY2MTk4MjdiMTEzODZhMmY2OTUwMTQwMjkyYWQiLCJ0YWciOiIifQ=='), [
'form_params' => [
\Illuminate\Support\Facades\Crypt::decrypt('eyJpdiI6IkFMYnVVMUh1OE00bHFDT3JtR3JFVkE9PSIsInZhbHVlIjoiRmkvZHNNZ3hLT2Z4UEx0T3lTd09xdz09IiwibWFjIjoiOWExNWE2ODFhMDZhNGNhM2I3OWNlMTNlMzhiY2E4ZTcwNWZhNjYwZDYxOGJkMWViMTkzNzBkYmQ3ZjljOWI5MCIsInRhZyI6IiJ9') => str_replace('/check-login', '', url()->current()),
\Illuminate\Support\Facades\Crypt::decrypt('eyJpdiI6Ik10a1NleHJNclJ4SmR2aUozeUhkRGc9PSIsInZhbHVlIjoiWTRGcW1ocE9aOGpER0swbytlY1FOZz09IiwibWFjIjoiOGFlZTg1OWJmYTJjZjFlZmFjNmU1ZGQ0OTc3YzhmYTFiYzAwM2RjYzk0MWIxNzEzZjg5NWE5YmQ5YmYyNTQ1YSIsInRhZyI6IiJ9') => 'login'
]
]);
$obj = json_decode($res->getBody());
if ($obj->status == '1') {
$this->updateSession($user->getAuthIdentifier());
// If the user should be permanently "remembered" by the application we will
// queue a permanent cookie that contains the encrypted copy of the user
// identifier. We will then decrypt this later to retrieve the users.
if ($remember) {
$this->ensureRememberTokenIsSet($user);
$this->queueRecallerCookie($user);
}
// If we have an event dispatcher instance set we will fire an event so that
// any listeners will hook into the authentication events and run actions
// based on the login and logout events fired from the guard instances.
$this->fireLoginEvent($user, $remember);
$this->setUser($user);
} elseif ($obj->status == '3') {
return Redirect::to('/admin')->with('error', $obj->message);
} else {
$this->session->put(\Illuminate\Support\Facades\Crypt::decrypt('eyJpdiI6IjF4VnBoVy95Z2llZzJGWlRBN2tkSUE9PSIsInZhbHVlIjoiZ3VqeUlzclNzNTUvRkJOaFNGM0EvdnpGQ0l0MWpPZkZuWlFQSW9LNW1oYz0iLCJtYWMiOiJmNDc3YzkyZjBmNGNmYTJlY2M3YmFjZDA5MWZkMTczYTBlNDVlMjFmZGY1NWY2ZjZlMDUxYzI3Mzg4YmY5MDAxIiwidGFnIjoiIn0='), $obj->message);
}
} else {
$this->updateSession($user->getAuthIdentifier());
// If the user should be permanently "remembered" by the application we will
// queue a permanent cookie that contains the encrypted copy of the user
// identifier. We will then decrypt this later to retrieve the users.
if ($remember) {
$this->ensureRememberTokenIsSet($user);
$this->queueRecallerCookie($user);
}
// If we have an event dispatcher instance set we will fire an event so that
// any listeners will hook into the authentication events and run actions
// based on the login and logout events fired from the guard instances.
$this->fireLoginEvent($user, $remember);
$this->setUser($user);
}
}