Disable verification email for specific app

Hi everyone,

I would like to disable the verification email for one of my applications.
I decide to do it in pre-registration hook.
My code is here:

module.exports = function (user, context, cb) {
  var response = {};
   
  response.user = user;
  
  if (context.connection.id === 'XXXXXXXXXXXXXX') // matching with my app client_id
    // don't send verification email
    response.user.emailVerified = true;
  }

  cb(null, response);
};

What’s wrong with my code? What is the best way to do it?

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?