diff --git a/config/devdojo/auth/language.php b/config/devdojo/auth/language.php index a8af6b3..afe5aa0 100644 --- a/config/devdojo/auth/language.php +++ b/config/devdojo/auth/language.php @@ -11,6 +11,7 @@ 'show_subheadline' => false, 'email_address' => 'Email Address', 'password' => 'Password', + 'remember_me' => 'Remember me', 'edit' => 'Edit', 'button' => 'Continue', 'forget_password' => 'Forget your password?', diff --git a/resources/views/pages/auth/login.blade.php b/resources/views/pages/auth/login.blade.php index a82cd2c..996d308 100644 --- a/resources/views/pages/auth/login.blade.php +++ b/resources/views/pages/auth/login.blade.php @@ -22,6 +22,9 @@ #[Validate('required')] public $password = ''; + #[Validate('bool')] + public $rememberMe = false; + public $showPasswordField = false; public $showIdentifierInput = true; @@ -46,7 +49,7 @@ public function editIdentity(){ $this->showPasswordField = false; return; } - + $this->showIdentifierInput = true; $this->showSocialProviderInfo = false; } @@ -100,11 +103,11 @@ public function authenticate() return redirect()->route('auth.two-factor-challenge'); } else { - if (!Auth::attempt($credentials)) { + if (!Auth::attempt($credentials, $this->rememberMe)) { $this->addError('password', trans('auth.failed')); return; } - + event(new Login(auth()->guard('web'), $this->userModel->where('email', $this->email)->first(), true)); if(session()->get('url.intended') != route('logout.get')){ @@ -165,7 +168,8 @@ public function authenticate() @if($showPasswordField) -
+ +
{{ config('devdojo.auth.language.login.forget_password') }}
@endif