diff --git a/WP_Auth0.php b/WP_Auth0.php index dd6a5e0e2..1f64856ea 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.0.0 + * Version: 1.0.1 * Author: 1337 ApS * Author URI: http://1337.dk */ @@ -249,6 +249,8 @@ private static function dieWithVerifyEmail($userinfo, $data) { $domain = WP_Auth0_Options::get( 'domain' ); $token = $data->id_token; $email = $userinfo->email; + $connection = $userinfo->identities[0]->connection; + $userId = $userinfo->user_id; include WPA0_PLUGIN_DIR . 'templates/verify-email.php'; $html = ob_get_clean(); @@ -257,10 +259,20 @@ private static function dieWithVerifyEmail($userinfo, $data) { } private static function login_user( $userinfo, $data ){ - // If the userinfo has an unverified email, and in the options we require a verified email + // 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 (!$userinfo->email_verified && WP_Auth0_Options::get( 'requires_verified_email' )) { - self::dieWithVerifyEmail($userinfo, $data); + if (WP_Auth0_Options::get( 'requires_verified_email' )){ + if (empty($userinfo->email)) { + $msg = __('This account does not have an email associated. Please login with a different provider.', WPA0_LANG); + $msg .= '

'; + $msg .= '' . __('← Go back', WPA0_LANG) . ''; + + wp_die($msg); + } + if (!$userinfo->email_verified) { + self::dieWithVerifyEmail($userinfo, $data); + } + } // See if there is a user in the auth0_user table with the user info client id diff --git a/readme.txt b/readme.txt index ee308f51f..232ef6938 100644 --- a/readme.txt +++ b/readme.txt @@ -24,6 +24,14 @@ Before you start, make sure the admin user has a valid email that you own, read 1. In `settings` - `Auth0 Settings` edit the *Domain*, *Client ID* and *Client Secret* from your auth0 dashboard 1. Go to your auth0 dashboard, edit your application and add this to the available callbacks http:///index.php?auth0=1 +== Screenshots == + +1. The new login page +2. The admin to configure the plugin +3. Auth0 admin to create a new Application +4. You can enable or disable social plugins +5. This is what happens if you are in the admin and your session expires +6. You can configure enterprise connections == Technical Notes == diff --git a/screenshot-1.png b/screenshot-1.png new file mode 100644 index 000000000..9fea649dc Binary files /dev/null and b/screenshot-1.png differ diff --git a/screenshot-2.png b/screenshot-2.png new file mode 100644 index 000000000..4f5db938f Binary files /dev/null and b/screenshot-2.png differ diff --git a/screenshot-3.png b/screenshot-3.png new file mode 100644 index 000000000..2c105fdd0 Binary files /dev/null and b/screenshot-3.png differ diff --git a/screenshot-4.png b/screenshot-4.png new file mode 100644 index 000000000..291920409 Binary files /dev/null and b/screenshot-4.png differ diff --git a/screenshot-5.png b/screenshot-5.png new file mode 100644 index 000000000..e8739bb1d Binary files /dev/null and b/screenshot-5.png differ diff --git a/screenshot-6.png b/screenshot-6.png new file mode 100644 index 000000000..13c5a4ec0 Binary files /dev/null and b/screenshot-6.png differ diff --git a/templates/verify-email.php b/templates/verify-email.php index 8f9ae0d27..2b0339af5 100644 --- a/templates/verify-email.php +++ b/templates/verify-email.php @@ -1,28 +1,32 @@ - +
+

+