diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index 53288a0..c5c87c1 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -33,7 +33,7 @@ public function boot(): void Fortify::resetUserPasswordsUsing(ResetUserPassword::class); RateLimiter::for('login', function (Request $request) { - $email = (string)$request->username; + $email = (string)$request->email; return Limit::perMinute(5)->by($email . $request->ip()); }); diff --git a/app/Providers/NukeServiceProvider.php b/app/Providers/NukeServiceProvider.php index bf0b704..6e295c6 100644 --- a/app/Providers/NukeServiceProvider.php +++ b/app/Providers/NukeServiceProvider.php @@ -37,8 +37,7 @@ public function register() public function boot() { RateLimiter::for('login', function (Request $request) { - $email = (string)$request->username; - + $email = (string)$request->email; return Limit::perMinute(5)->by($email . $request->ip()); }); @@ -70,8 +69,8 @@ public function boot() return session()->put(['attempt-failed' => Lang::get('passwords.attempt'), 'end_time' => time() + 300]); } - $user = User::where('email', $request->username) - ->orWhere('username', $request->username) + $user = User::where('email', $request->email) + ->orWhere('username', $request->email) ->first(); if ($user && Hash::check($request->password, $user->password)) { diff --git a/resources/assets/js/pages-auth.js b/resources/assets/js/pages-auth.js index a99c968..dec5cd8 100644 --- a/resources/assets/js/pages-auth.js +++ b/resources/assets/js/pages-auth.js @@ -25,10 +25,11 @@ document.addEventListener('DOMContentLoaded', function (e) { email: { validators: { notEmpty: { - message: 'Please enter your email' + message: 'Please enter your Username or Email' }, - emailAddress: { - message: 'Please enter valid email address' + stringLength: { + min: 6, + message: 'Username or Email must be more than 6 characters' } } }, diff --git a/resources/views/auth/auth-login.blade.php b/resources/views/auth/auth-login.blade.php index 1592269..a425e9d 100644 --- a/resources/views/auth/auth-login.blade.php +++ b/resources/views/auth/auth-login.blade.php @@ -93,7 +93,7 @@ class="app-brand-text demo text-body fw-bold ms-1">Codebumble Inc. @csrf