Skip to content
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

Change failure of MFA from redirect to error message #776

Open
dqwiki opened this issue Dec 20, 2022 · 2 comments
Open

Change failure of MFA from redirect to error message #776

dqwiki opened this issue Dec 20, 2022 · 2 comments

Comments

@dqwiki
Copy link
Member

dqwiki commented Dec 20, 2022

When putting in a MFA code, if it fails, it kicks you back to login in again, instead of asking you to try again.

@methecooldude
Copy link
Member

I believe this is because

throw new ApplicationLogicException("Authentication failed");
just throws an exception which then gets caught with a redirect to login at L104. Not sure if there is a way of changing the action based on it being MFA

@stwalkerster
Copy link
Member

Does it matter if we only allow a retry of an MFA? I'm fairly sure we can permit a retry of a password too?

I have no idea if this would work, but perhaps we could change:

WebRequest::clearAuthPartialLogin();
SessionAlert::error($ex->getMessage());
$this->redirect('login');

  • remove L101 so we don't reset the session on auth failure
  • change the redirect on L104 to redirect to the current page (convert POST to GET; can't remember if a plain ->redirect() goes to the current page or to the home page)

If we take this approach, I'd quite like to have a "cancel auth" or "logout" button if the auth is beyond the first stage to keep current functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants