Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion class-duouniversal-wordpressplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ function duo_authenticate_user( $user = '', $username = '', $password = '' ) {
\remove_action( 'authenticate', 'wp_authenticate_username_password', 20 );
\remove_action( 'authenticate', 'wp_authenticate_email_password', 20 );

$user = \wp_authenticate_username_password( null, $username, $password );
/**
* Filter the user object, allowing other plugins to provide their own authentication methods.
*
* @param WP_User|WP_Error $user The authenticated user object or WP_Error on failure.
* @param string $username The username passed to the primary authentication method.
* @param string $password The password passed to the primary authentication method.
*
*/
$user = \apply_filters( 'duo_universal_authenticated_user', \wp_authenticate_username_password( null, $username, $password ), $username, $password );
if ( ! is_a( $user, 'WP_User' ) ) {
// maybe we got an email?
$user = \wp_authenticate_email_password( null, $username, $password );
Expand Down