diff --git a/app/Containers/Authentication/Actions/WebAdminLoginAction.php b/app/Containers/Authentication/Actions/WebAdminLoginAction.php index cba9f8325..1122689f7 100644 --- a/app/Containers/Authentication/Actions/WebAdminLoginAction.php +++ b/app/Containers/Authentication/Actions/WebAdminLoginAction.php @@ -24,7 +24,7 @@ class WebAdminLoginAction extends Action */ public function run(Request $request) { - $user = $this->call(WebLoginTask::class, [$request->email, $request->password, $request->remember_me]); + $user = $this->call(WebLoginTask::class, [$request->email, $request->password, $request->remember_me ?? false]); if (!$user->hasAdminRole()) { throw new UserNotAdminException(); diff --git a/app/Containers/Authentication/Tasks/WebLoginTask.php b/app/Containers/Authentication/Tasks/WebLoginTask.php index 7c3689b54..2d88be429 100644 --- a/app/Containers/Authentication/Tasks/WebLoginTask.php +++ b/app/Containers/Authentication/Tasks/WebLoginTask.php @@ -2,8 +2,9 @@ namespace App\Containers\Authentication\Tasks; -use App\Containers\Authentication\Exceptions\AuthenticationFailedException; +use App\Containers\Authentication\Exceptions\LoginFailedException; use App\Ship\Parents\Tasks\Task; +use Auth; /** * Class WebLoginTask. @@ -19,10 +20,13 @@ class WebLoginTask extends Task * * @return mixed */ - public function run($email, $password, $remember = false) + public function run($email, $password, bool $remember = false) { - // TODO:.. - dump('incomplete..'); + if (!$user = Auth::attempt(['email' => $email, 'password' => $password], $remember)) { + throw new LoginFailedException(); + } + + return Auth::user(); } } diff --git a/app/Containers/Authentication/UI/WEB/Views/login.blade.php b/app/Containers/Authentication/UI/WEB/Views/login.blade.php index afa3a5aa7..ede711ae8 100644 --- a/app/Containers/Authentication/UI/WEB/Views/login.blade.php +++ b/app/Containers/Authentication/UI/WEB/Views/login.blade.php @@ -113,7 +113,7 @@

Login

-