From 21207b9f7155fb5fbc278e1793770868066bff17 Mon Sep 17 00:00:00 2001 From: German Lena Date: Tue, 19 May 2015 16:11:11 -0300 Subject: [PATCH 1/3] Fix issue with email verified requirement --- WP_Auth0.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WP_Auth0.php b/WP_Auth0.php index 8a52dd68e..298055654 100644 --- a/WP_Auth0.php +++ b/WP_Auth0.php @@ -537,7 +537,9 @@ private static function dieWithVerifyEmail($userinfo, $data) { private static function login_user( $userinfo, $data ){ // If the userinfo has no email or an unverified email, and in the options we require a verified email // notify the user he cant login until he does so. - if (WP_Auth0_Options::get( 'requires_verified_email' )){ + $requires_verified_email = WP_Auth0_Options::get( 'requires_verified_email' ); + + if ($requires_verified_email == 1){ if (empty($userinfo->email)) { $msg = __('This account does not have an email associated. Please login with a different provider.', WPA0_LANG); $msg .= '

'; @@ -545,6 +547,9 @@ private static function login_user( $userinfo, $data ){ wp_die($msg); } + + + if (!$userinfo->email_verified) { self::dieWithVerifyEmail($userinfo, $data); } From d60032cc73b2847bdaf06897de283e6b51487e3d Mon Sep 17 00:00:00 2001 From: German Lena Date: Tue, 19 May 2015 16:11:11 -0300 Subject: [PATCH 2/3] Fix issue with email verified requirement --- WP_Auth0.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WP_Auth0.php b/WP_Auth0.php index 8a52dd68e..298055654 100644 --- a/WP_Auth0.php +++ b/WP_Auth0.php @@ -537,7 +537,9 @@ private static function dieWithVerifyEmail($userinfo, $data) { private static function login_user( $userinfo, $data ){ // If the userinfo has no email or an unverified email, and in the options we require a verified email // notify the user he cant login until he does so. - if (WP_Auth0_Options::get( 'requires_verified_email' )){ + $requires_verified_email = WP_Auth0_Options::get( 'requires_verified_email' ); + + if ($requires_verified_email == 1){ if (empty($userinfo->email)) { $msg = __('This account does not have an email associated. Please login with a different provider.', WPA0_LANG); $msg .= '

'; @@ -545,6 +547,9 @@ private static function login_user( $userinfo, $data ){ wp_die($msg); } + + + if (!$userinfo->email_verified) { self::dieWithVerifyEmail($userinfo, $data); } From f462ae322ac6355c7a3105c864ccab33d205701e Mon Sep 17 00:00:00 2001 From: German Lena Date: Tue, 19 May 2015 16:19:40 -0300 Subject: [PATCH 3/3] updated version --- WP_Auth0.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WP_Auth0.php b/WP_Auth0.php index 298055654..707f20c34 100644 --- a/WP_Auth0.php +++ b/WP_Auth0.php @@ -2,7 +2,7 @@ /** * Plugin Name: Wordpress Auth0 Integration * Description: Implements the Auth0 Single Sign On solution into Wordpress - * Version: 1.2.2 + * Version: 1.2.3 * Author: Auth0 * Author URI: https://auth0.com */ @@ -12,7 +12,7 @@ define('WPA0_PLUGIN_URL', trailingslashit(plugin_dir_url(__FILE__) )); define('WPA0_LANG', 'wp-auth0'); define('AUTH0_DB_VERSION', 2); -define('WPA0_VERSION', '1.2.2'); +define('WPA0_VERSION', '1.2.3'); class WP_Auth0 { public static function init(){