Skip to content

Commit

Permalink
pushing loging error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shakilofficial0 committed Sep 20, 2023
1 parent 6024a04 commit 3b05604
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/Providers/FortifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
Expand Down
7 changes: 3 additions & 4 deletions app/Providers/NukeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});

Expand Down Expand Up @@ -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)) {
Expand Down
7 changes: 4 additions & 3 deletions resources/assets/js/pages-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/auth-login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class="app-brand-text demo text-body fw-bold ms-1">Codebumble Inc.</span>
@csrf
<div class="mb-3">
<label for="email" class="form-label">Email or Username</label>
<input type="text" class="form-control" id="email" name="username"
<input type="text" class="form-control" id="email" name="email"
placeholder="Enter your email or username" autofocus>
</div>
<div class="mb-3 form-password-toggle">
Expand Down

0 comments on commit 3b05604

Please sign in to comment.