Is there a way to access user management api from a post-password-change action?

Is there a way to access user management api from a post-password-change action?

Probably the easiest way to do this is to use the Auth0 Node SDK in the action. Example:

exports.onExecutePostChangePassword = async (event) => {
  const ManagementClient = require('auth0').ManagementClient
  
  const management = new ManagementClient({
    domain: 'REPLACE_WITH_TENANT_DOMAIN',
    clientId: event.secrets.MGMT_CLIENT_ID,
    clientSecret: event.secrets.MGMT_CLIENT_SECRET
  })

  // Example
  const res = await management.getUsersByEmail(event.user.email)
  console.log(res)
};

Make sure that you install the auth0 npm module (from the Modules section), and set the two secrets (from the Secrets section).

1 Like

Thanks for helping on this one @thameera !