-
-
Notifications
You must be signed in to change notification settings - Fork 17
Sync Fortify and Passkeys updates #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4078db8
11fdf22
6079e05
69b874c
17f8dba
2f05c84
d62687b
a075d2d
252cd05
888a512
3bf2c53
fe16d0a
ab5eece
d77ce5b
cc7f84e
9ac4124
e502e65
7906320
d263851
ed3ed48
cf94efc
82a6476
43ba469
91cd279
172de80
0ade3ee
1c93a5d
e3d4825
8954cdf
0fa7667
921ef94
15bb9f3
67a09c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |||||
| use Hypervel\Fortify\LoginRateLimiter; | ||||||
| use Hypervel\Fortify\TwoFactorAuthenticatable; | ||||||
| use Hypervel\Http\Request; | ||||||
| use Hypervel\Support\Timebox; | ||||||
| use Hypervel\Validation\ValidationException; | ||||||
| use RuntimeException; | ||||||
| use Symfony\Component\HttpFoundation\Response; | ||||||
|
|
@@ -75,21 +76,27 @@ protected function validateCredentials(Request $request): Authenticatable&Model | |||||
| } | ||||||
|
|
||||||
| $provider = $this->provider(); | ||||||
| $user = $provider->retrieveByCredentials($request->only(Fortify::username(), 'password')); | ||||||
|
|
||||||
| $password = $request->input('password'); | ||||||
| return (new Timebox)->call(function (Timebox $timebox) use ($request, $provider): Authenticatable&Model { | ||||||
| $user = $provider->retrieveByCredentials($request->only(Fortify::username(), 'password')); | ||||||
|
|
||||||
| if (! $user instanceof Authenticatable || ! $user instanceof Model || ! $provider->validateCredentials($user, ['password' => $password])) { | ||||||
| $this->fireFailedEvent($request, $user); | ||||||
| $password = $request->input('password'); | ||||||
|
|
||||||
| $this->throwFailedAuthenticationException($request); | ||||||
| } | ||||||
| if (! $user instanceof Authenticatable || ! $user instanceof Model || ! $provider->validateCredentials($user, ['password' => $password])) { | ||||||
| $this->fireFailedEvent($request, $user); | ||||||
|
|
||||||
| if ($this->config->boolean('hashing.rehash_on_login')) { | ||||||
| $provider->rehashPasswordIfRequired($user, ['password' => $password]); | ||||||
| } | ||||||
| $this->throwFailedAuthenticationException($request); | ||||||
| } | ||||||
|
|
||||||
| return $user; | ||||||
| if ($this->config->boolean('hashing.rehash_on_login')) { | ||||||
| $provider->rehashPasswordIfRequired($user, ['password' => $password]); | ||||||
| } | ||||||
|
|
||||||
| // Only failed attempts need a fixed duration, so successful logins skip the wait, as SessionGuard does. | ||||||
| $timebox->returnEarly(); | ||||||
|
|
||||||
| return $user; | ||||||
| }, $this->config->integer('auth.timebox_duration')); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Prompt for AI agents
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changing this. |
||||||
| } | ||||||
|
|
||||||
| /** | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.