# Email\_verified not set after user verification

**URL:** <https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687>\
**Category:** Get Help\
**Tags:** email\_verified, email-verification, auth0, verification-email\
**Created:** [June 15, 2020, 1:59pm UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687 "2020-06-15T13:59:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nkr/32/13700_2.png) [@nkr](https://community.auth0.com/u/nkr)\
**Post date:** [June 15, 2020, 1:59pm UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687/1 "2020-06-15T13:59:49Z")

</div>

Hey community,

We noticed an indicident where a user had successfully received their verification email and followed it to verify their account. However, the raw json data still shows the “email\_verified” as false, and we don’t have a way to manually check up on this. The issue now is that our database correctly set the verified column to true for this user, but the auth0 json we check is false, and we check it on the json variable to see if we should re-send verification email if X time has passed and they log on again.

Any feedback is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 16, 2020, 4:56pm UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687/3 "2020-06-16T16:56:41Z")

</div>

Hi @nkr,

Welcome back 😄

How are you setting email verified in your DB? If they click the link it should be verified, as long as the request is made successfully.

---

<div class="post-metadata">

**Author:** ![nkr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nkr/32/13700_2.png) [@nkr](https://community.auth0.com/u/nkr)\
**Post date:** [June 17, 2020, 7:33am UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687/4 "2020-06-17T07:33:11Z")

</div>

Hi Dan,

Thank you 🙂

I set the email verified in our DB using the custom database action script under Verify, with:

```
function verify (email, callback) {
  //this example uses the "tedious" library
  //more info here: http://pekim.github.io/tedious/index.html

  var Connection = require('tedious@1.11.0').Connection;
  var Request = require('tedious@1.11.0').Request;
  var TYPES = require('tedious@1.11.0').TYPES;

  var connection = new Connection({
    userName: configuration.username,
    password: configuration.password,
    server: configuration.server,
    options: {
      database: configuration.database_new,
      encrypt: true
    }
  });

   var query = 'UPDATE [User].UserCredentials SET EmailConfirmed = 1 ' +
    'WHERE Email = @Email';

  connection.on('debug', function(text) {
    // Uncomment next line in order to enable debugging messages
    // console.log(text);
  }).on('errorMessage', function(text) {
    console.log(JSON.stringify(text, null, 2));
  }).on('infoMessage', function(text) {
    // Uncomment next line in order to enable information messages
    // console.log(JSON.stringify(text, null, 2));
  });

  connection.on('connect', function (err) {
    if (err) { return callback(err); }

    var request = new Request(query, function (err, rows) {
      if (err) { return callback(err); }
      console.log('rows: ' + rows);
      callback(null, rows > 0);
    });

    request.addParameter('Email', TYPES.VarChar, email);

    connection.execSql(request);
  });
}

```

The saving in DB is successful, but somehow the email\_verified on the user JSON is still false

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 18, 2020, 8:35pm UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687/5 "2020-06-18T20:35:41Z")

</div>

Could you **DM me** the tenant namd and user\_id of the affected user?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 3, 2020, 12:35am UTC](https://community.auth0.com/t/email-verified-not-set-after-user-verification/44687/6 "2020-07-03T00:35:42Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
