Auth0 Home Blog Docs

Forgot password with custom email template


#1

Hi ,
I have implemented auth0 sent email functionality for forgot password. Its working fine in which I have customise email template with our application link. please find below code snippet for that

var webAuth0 = new auth0.WebAuth({
        domain:       '[tenant].auth0.com',
        clientID:     '0EvIxFA6k***********qlaZGxO72K'
      });
      webAuth0.changePassword({
        connection: 'Username-Password-Authentication',
        email:   this.loginUser.email
      }, function (err, resp) {
        if(err){
          console.log(err.message);
        }else{
          console.log(resp);
          that.emailSent = true;
        }
      });

But I am unable to find any api/sdk in auth0 so that I can reset password without authToken. I have tried with “/dbconnections/change_password” with passing password in request but its not working.

Please help me on how to reset password for a user who forgot his password, for that access token is not available.


Bad Audience when using a custom API
#2

Hi,

Any user that forgot their password can conveniently click on forgotten password link in Lock widget to receive a password-reset email.

Alternatively, if you want to use API, one of these options:

  1. User-initiated change password, that sends an Email to user with a link: https://auth0.com/docs/api/authentication#change-password

  2. As a superuser with valid access_token to management API, PATCH user: https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id

  3. As a superuser with valid access_token to management API, generate a password reset link for given user: https://auth0.com/docs/api/management/v2#!/Tickets/post_password_change

Hope that helps,
Amin