I’m trying to update the user email_verified status flag in a pre-registration hook to suppress sending the verification email for a certain connection type. I use multiple connections with different use cases. The pre-registration hook appears to update the user and returns the response(seen in logs), however, the data isn’t persisted to the user data. It just doesn’t update the email_verified flag.
Code snippet.
module.exports = function (user, context, cb) {
var response = {};
console.log("Email Verified Suppression: context DATA", context);
response.user = user;
const AdvocatesConnectionName = "Advocate";
if (context.connection.name === AdvocatesConnectionName) {
response.user.email_verified = true;
}
console.log("Email Verified Suppression EXIT: context DATA", response);
cb(null, response);
};
Am I using this pre-hook wrong?
Side note: The Auth0 documentation is rich in articles but hard to follow connecting articles, contradictory and somewhat unclear.