Skip to content
Merged
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
11 changes: 8 additions & 3 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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(){
Expand Down Expand Up @@ -537,14 +537,19 @@ 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 .= '<br/><br/>';
$msg .= '<a href="' . site_url() . '">' . __('← Go back', WPA0_LANG) . '</a>';

wp_die($msg);
}



if (!$userinfo->email_verified) {
self::dieWithVerifyEmail($userinfo, $data);
}
Expand Down