How can I use `api.user` in a post change password action?

This post discusses using api.user... to set user meta data from within a pre-registration or post-login action. But how can I do this from a post change password action?

If I try to, I get an error:

Property ‘user’ does not exist on type ‘PostChangePasswordAPI’

I have a flag set on user app meta, mustChangePass, and after they’ve changed password I want to unset that flag.

Hello @kkrp1,

Welcome back to the Auth0 community!

Unfortunately, there is no API object provided within this flow. What you are trying to do is possible using the Management API. Check the following Solution for further information on this: Update User Metadata from Within a Post Change Password Action

I hope this was helpful.

Thanis,
Tudor

Thanks, @tudor.smeu. I’ve read some of those posts. The trouble is that they each link to each other, and it can be very cirucuitous and tiresome reading to get to the simple answer. It would be great if Auth0 could just do a full demo somewhere of how to use the management API (or specifically update user meta) from any action. It’s also not clear from the linked thread how creating a maching-to-machine application serves this purpose. If I create the application, how is it then used inside an action?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.