Auth0 Home Blog Docs

How to set the field verify_email as false when using passport-auth0



I am trying to create a user using passport-auth0 Node.js library. I want to send the customised verification email after sometime via an API call. I have seen example wherein it was demonstrated about how to set verify_email as false by creating users using Auth0 Management API /api/v2/users. I would like to know how to achieve the same using the passport auth0 strategy.

I have the following middleware when the user signs up

passport.authenticate('auth0', {
        clientID: process.env.AUTH0_CLIENT_ID,
        domain: process.env.AUTH0_DOMAIN,
        redirectUri: 'http://localhost:5000/callback/',
        responseType: 'code',
        audience: 'https://' + process.env.AUTH0_DOMAIN + '/userinfo',
        scope: 'openid profile email'

I would like to know how to set the verify_email key as false for the newly created user. Can it be done only after authentication or is there any extra field that can be set to the middleware shown above??


The verify_emailoption is only available through the create user endpoint of the Auth0 Management API v2 so what you’re trying to accomplish is not available through the passport strategy which just redirects the end-user when there is not an active authentication session. the strategy by itself does not care if completion of the authentication will be made by first signing up for a new account or just by providing credentials associated with an existing account.

In conclusion, if you want that level of control you would need to creates users through that endpoint instead of the public signup endpoint used when end-users sign-up through Lock, for example.