GithubHelp home page GithubHelp logo

Comments (7)

driesvints avatar driesvints commented on April 27, 2024 3

We're gonna look into that eventually but definitely feel free to send in a PR if you'd like.

from fortify.

driesvints avatar driesvints commented on April 27, 2024

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.

sebdesign avatar sebdesign commented on April 27, 2024

@driesvints will check now

from fortify.

sebdesign avatar sebdesign commented on April 27, 2024

@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.

driesvints avatar driesvints commented on April 27, 2024

What prevents you from overriding RedirectIfTwoFactorAuthenticatable?

from fortify.

sebdesign avatar sebdesign commented on April 27, 2024

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.

driesvints avatar driesvints commented on April 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.