-
Notifications
You must be signed in to change notification settings - Fork 153
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
ReAuth: resolve fatal, code cleanup #567
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ts. Realistically, as $existing_providers is false this check shouldn't be needed, but this ensures we don't overwrite it anyway.
iandunn
approved these changes
May 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works in my tests, and the code LGTM 👍🏻
Co-authored-by: Ian Dunn <ian@iandunn.name>
…Two_Factor_Core::get_current_user_session, and Two_Factor_Core::update_current_user_session.
…ance of the provider is returned.
…ctivated) provider for a user.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
See #565, #566
This centralises the provider selection into it's own method for clarity around it's logic, resolving a fatal error in the process, but replacing it with a dead-end
Cheating huh?
style error. This error condition should not be possible to be hit under normal circumstances.More importantly, this adds Session metadata helpers (That should probably be provided by core) for retrieving/updating the current user session.
Through that, the 2fa-session flag is cleared upon the providers being disabled.
Why?
In comparison to #566 this resolves the underlying fatal in a way that can't be reintroduced, fixes some merge bugs (ie.
get_class( $provider )
is replaced by$provider->get_key()
), and reduces code duplication.The unit test from #566 is included.
How?
Testing Instructions
See #565 #566
Screenshots or screencast
Changelog Entry
N/A - Bugfix for unreleased feature.