-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store the two-factor details in the user session at login time (#528)
* Store the two factor login timestamp and provider in the user session. * Create the user session directly attaching data to it, rather than using filters. * Add a method to determine if the current login session is two factored. * Use an anonymous function attached to a callback to set the user session information. * Tests: Add a test that validates that is_current_user_session_two_factor() doesn't return true when the cookie is set from outside of the two-factor handler. * Make is_current_user_session_two_factor() more readable. * Make Two_Factor_Core::login_form_validate_2fa() testable, by not calling exit; * Tests: Add tests that validate that the 2fa status is appropriately set in the user session. * Remove misplaced `@covers` annotation. Co-authored-by: Ian Dunn <[email protected]> * Correct an @Covers annotation. Co-authored-by: Ian Dunn <[email protected]> * Update to reflect #546 * Tests: Simplify the cookie management. * Be more explicit about the return value. * Use a static anonymous function, as $this isn't needed. * Simplify the wrapper by allowing _login_form_validate_2fa() to always be exited after calling. * Simplify by passing $provider as a string always. * Update @SInCE tags. --------- Co-authored-by: Ian Dunn <[email protected]>
- Loading branch information
Showing
2 changed files
with
174 additions
and
22 deletions.
There are no files selected for viewing
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
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