404labfr / 404labfr/laravel-auth-checker

failed to add a db record after auth failure

Open Beginner friendly
#19 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
222
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Thank you for sharing,
i think i hit a bug...
if you simulate a failed login, and then log in successfully you will notice that no record was added due to the authentication throttling.

a normal behavior should be add a record if the type status changes regardless of throttling time, as this is a new state and should be logged.. so right now after a failed login, i do not get a successful log recorded.

the fix is as follow:
add this `&& $login['type'] == Login::TYPE_LOGIN` to the if statement as shown below in the:
`AuthChecker.php` file
` if (isset($login->created_at) && $login->created_at->gt($limit) && $login['type'] == Login::TYPE_LOGIN) {
return false;
}`

cheers,
Jay

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue points to the AuthChecker.php file. Look for the throttling logic that prevents logging a successful login after a failure. The suggested fix is to add a condition checking the login type. Start by examining the Login model constants and the existing throttling condition. Run any existing authentication tests to verify the behavior before and after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
authentication, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.