From fc8162f55c85e3d7c8c674322a3f095815ae5128 Mon Sep 17 00:00:00 2001 From: Lakshan Madushanka Date: Fri, 26 Jul 2024 15:49:37 +0530 Subject: [PATCH 1/4] Remember me feature for the login form --- config/devdojo/auth/language.php | 1 + resources/views/pages/auth/login.blade.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 a2b5147..b8bf2e4 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; @@ -100,7 +103,7 @@ 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; } @@ -166,6 +169,7 @@ public function authenticate() @if($showPasswordField) +
{{ config('devdojo.auth.language.login.forget_password') }}
From 094b755dd776f5c053e1ebb67a21cec6ce1e7c06 Mon Sep 17 00:00:00 2001 From: Lakshan Madushanka Date: Fri, 26 Jul 2024 16:25:17 +0530 Subject: [PATCH 2/4] Merge conflict resolve --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d75b02f..f7b9ad0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - extensions: mbstring, xml, ctype, iconv, mysql + extensions: mbstring, xml, ctype, iconv, mysql, imagick - name: Cache Composer Packages uses: actions/cache@v2 From 09a2e06ff4146b7075e1c51caf6b81757e931ee4 Mon Sep 17 00:00:00 2001 From: Lakshan Madushanka Date: Fri, 26 Jul 2024 16:26:53 +0530 Subject: [PATCH 3/4] Merge conflict resolve --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index fba0a85..6e4cdbf 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ ], "require": { "php": "^7.4|^8.0|^8.1|^8.2", + "ext-imagick": "^3.4", "illuminate/support": "^8.0|^9.0|^10.0|^11.0", "laravel/folio": "^1.0", "livewire/livewire": "^3.0", From 5be791e47a99ed0fccbe798f7d80e9fef0d3bd0f Mon Sep 17 00:00:00 2001 From: Lakshan Madushanka Date: Fri, 26 Jul 2024 16:41:29 +0530 Subject: [PATCH 4/4] Fix indentation and checkbox component --- resources/views/pages/auth/login.blade.php | 90 +++++++++++----------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/resources/views/pages/auth/login.blade.php b/resources/views/pages/auth/login.blade.php index 18fd20f..996d308 100644 --- a/resources/views/pages/auth/login.blade.php +++ b/resources/views/pages/auth/login.blade.php @@ -125,71 +125,71 @@ public function authenticate() ?> - + @volt('auth.login') - + - - + - @if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') == 'top') - - @endif + @if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') == 'top') + + @endif -
+ - @if($showPasswordField) - - - - @else - @if($showIdentifierInput) - + @if($showPasswordField) + + + + @else + @if($showIdentifierInput) + + @endif @endif - @endif - @if($showSocialProviderInfo) -
- {{ str_replace('__social_providers_list__', implode(', ', $userSocialProviders), config('devdojo.auth.language.login.social_auth_authenticated_message')) }} - -
+ @if($showSocialProviderInfo) +
+ {{ str_replace('__social_providers_list__', implode(', ', $userSocialProviders), config('devdojo.auth.language.login.social_auth_authenticated_message')) }} + +
- @if(!config('devdojo.auth.settings.login_show_social_providers')) - + /> + @endif @endif - @endif - @if($showPasswordField) - - -
- {{ config('devdojo.auth.language.login.forget_password') }} -
- @endif + @if($showPasswordField) + + +
+ {{ config('devdojo.auth.language.login.forget_password') }} +
+ @endif - - {{ config('devdojo.auth.language.login.button') }} - - + + {{ config('devdojo.auth.language.login.button') }} + + -
- {{ config('devdojo.auth.language.login.dont_have_an_account') }} - {{ config('devdojo.auth.language.login.sign_up') }} -
+
+ {{ config('devdojo.auth.language.login.dont_have_an_account') }} + {{ config('devdojo.auth.language.login.sign_up') }} +
- @if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') != 'top') - - @endif + @if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') != 'top') + + @endif -
+
@endvolt - +
\ No newline at end of file