You are here

function auth0_fail_with_verify_email in Auth0 Single Sign On 7.2

Display a message and cancel login if the user does not have a verified email.

1 call to auth0_fail_with_verify_email()
auth0_login_auth0_user in ./auth0.module
Log in an Auth0 authenticated user.

File

./auth0.module, line 268

Code

function auth0_fail_with_verify_email($idToken) {
  $url = url('auth0/verify_email', array());
  $formText = "<form style='display:none' name='auth0VerifyEmail' action=@url method='post'><input type='hidden' value=@token name='idToken'/></form>";
  $linkText = "<a href='javascript:null' onClick='document.forms[\"auth0VerifyEmail\"].submit();'>here</a>";
  $message = t($formText . "Please verify your email and log in again. Click {$linkText} to resend verification email.", array(
    '@url' => $url,
    '@token' => $idToken,
  ));
  drupal_set_message($message, 'warning');
  return drupal_goto();
}