Auth0 Home Blog Docs

Forcefully Redirect to reset password on first Redirect

I have migrated users in auth0 with a default password and want to redirect user on reset password page on the first-time login. Is there any settings/Flag while the user migration or any rule/hook I can create to get reset password page to user for first login

Hi @mayuri.mantri,

You should be able to accomplish this in a rule using the user.last_password_reset object.

Check out this example. It should get you most of the way there. Let me know if you run into anything and I will help.

Thanks,
Dan

1 Like

Thanks @dan.woda for you reply, But I want to redirect user to reset password page of Auth0 , Using your solution I can redirect to my application changepassword page. How I can set redirect url to reset password link of auth0 in
context.redirect = {
url: “https://example.com/change-pw?token=” + token
};

You can use this endpoint to generate the pw change URL:

https://auth0.com/docs/api/management/v2#!/Tickets/post_password_change

You can redirect a user to this URL from within a rule, like I mentioned above.

Let me know if this works for you,
Dan