Post registration and post login actions do not update app metadata

We have been using auth0 for awhile in our application, and we moved rules to actions awhile back and we realize it is not working as expected, meaning user app meta data is not updated.

for post registration,

exports.onExecutePostUserRegistration = async (event) => {

 event.user.app_metadata.sample_field = 'some field we want to update to'

for post login

exports.onExecutePostLogin = async (event, api) => {

api.user.setAppMetadata('sample_field', 'some field we want to update to')


User app metadata is not being updated either way, both actions are called and there is no error regarding any of the actions.

is this way of updating user app metadata no longer supported?

1 Like

Hi @mahder,

Welcome to the Auth0 Community!

You should not use a post reg action to update user metadata. Please see this FAQ for more details: Can I use a post-user registration action (or hook) to update a user?

You should be able to accomplish what you have described with a post-login action here. Let’s take a look at how you’ve set up your action.

Can you please DM me the name of the effected tenant so I can take a look?

1 Like