Comments (7)
We're gonna look into that eventually but definitely feel free to send in a PR if you'd like.
from fortify.
I think this is fixed with #127. Can you confirm that you have disabled 2FA? And try the changes from the PR? I'll tag those in a bit.
from fortify.
@driesvints will check now
from fortify.
@driesvints I can confirm that with disabled 2FA, the RedirectIfTwoFactorAuthenticatable
action is not executed. Which solves the issue for failed non-2FA login attempts.
However, If I enable 2FA, I need to override/extend RedirectIfTwoFactorAuthenticatable
in order to customize the
error bag on the ValidationException
, because this action does it own validation.
But if the user doesn't have a two_factor_secret
and does not use the TwoFactorAuthenticatable
trait, the AttemptToAuthenticate
action will be executed next, and the credentials will be validated once again.
I don't know if that's important, but that leads to a duplicate query to validate/fetch the user.
from fortify.
What prevents you from overriding RedirectIfTwoFactorAuthenticatable
?
from fortify.
I don't mind overriding it, since there's nothing that prevents me to do so.
What bugs me is that I have to do the exact change twice, because the credentials validation is kicking in twice, and there's also the "issue" of the duplicate queries:
(1) Handle `RedirectIfTwoFactorAuthenticatable`
(2) Validate credentials (first query)
(3a) Throw exception if (2) fails
(3b) Otherwise, check `two_factor_secret` and `TwoFactorAuthenticatable`
(4a) If both are true, return the challange response
(4b) Otherwise, handle `AttemptToAuthenticate `
(5) Attempt to authenticate again (same query as (2))
(6a) If login succeeded, handle `PrepareAuthenticatedSession`
(6b) Otherwise, throw `ValidationException` like (3a)
from fortify.
I'm going to close this one already since the only issue is a duplicate query which I don't consider a huge problem.
from fortify.
Related Issues (20)
- Accept pull request for adding named route for two-factor auth challenge? HOT 1
- Fortify HOT 2
- The route name for registration is not declared. HOT 2
- difficulties in updating the database schema HOT 1
- Laravel 10.10 - Cast password "hashed" HOT 3
- login limiter doesn't work actually HOT 1
- When Session based Guard is not used Logout fails HOT 3
- Integrate Precognition Into Fortify Route HOT 1
- Route [logout] not defined after changing the app_env from local to production
- Without override the PasswordResetLinkController@store we cannot add reCAPTCHA HOT 1
- Name all routes for Ziggy support when enableViews is false HOT 2
- Paths override with dot in route name does not work HOT 3
- Fortify http request methods for routes requiring multipart/form-data HOT 1
- Support for laravel passport HOT 2
- Provide "Don't ask me again on this computer" feature HOT 3
- Implementation for ActivityLogs HOT 1
- Custom Rate Limiter HOT 1
- Confusion between the username/email field in the database and the username/email field in the request (form) HOT 4
- No error message on expired token HOT 4
- Can we get a way to add additional validation rules to LoginRequest?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortify.