# A user's app\_metadata is not available in post-login Action event

**URL:** <https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829>\
**Category:** Get Help\
**Tags:** actions\
**Created:** [November 26, 2021, 5:27pm UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829 "2021-11-26T17:27:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuart.forrest](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stuart.forrest/32/33282_2.png) [@stuart.forrest](https://community.auth0.com/u/stuart.forrest)\
**Post date:** [November 26, 2021, 5:27pm UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829/1 "2021-11-26T17:27:53Z")

</div>

We have a pipeline of `post-login` Actions that execute for our users.

- Action 1 sets some `app_metadata` against the user on first login only, which works great  
\*\* We can see that is set (permanently) after the fact by querying the user
- Action 2 attempts to use this metadata on every login, first and subsequent  
\*\* Whilst the metadata is permanently attached to the user by Action 1 it is not available to Action 2 in subsequent logins

The docs [here](https://auth0.com/docs/actions/triggers/post-login/event-object) seem to suggest a user’s `app_metadata` will be available in the Action `event` object but it isn’t, only the metadata set in the current execution of the login pipeline is.

There is the option to query the user via the Management API on subsequent logins but the documentation does not state this is required and seems to suggest it shouldn’t be.

Is this a bug that a user’s `app_metadata` is not available in the `post-login` action?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 1, 2021, 12:15am UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829/3 "2021-12-01T00:15:59Z")

</div>

Hi @stuart.forrest,

Welcome to the Auth0 Community!

I understand that you have been having problems getting the user’s app\_metadata when using a Post-Login Action.

After testing this myself, I was not able to reproduce your observed issues. Instead, I could create 2 Action scripts, where the first script would set some app\_metadata, and the second script would check for this metadata and perform some logic. In both the first and subsequent logins, the user’s app\_metadata can be fetched in the Actions scripts and execute my custom logic.

> [@stuart.forrest](#):
>
> Is this a bug that a user’s `app_metadata` is not available in the `post-login` action?

Given that, there aren’t any bugs with the way the Post-Login action script is supposed to work.

In this case, could you please share with me your 2 Action scripts for me to try to reproduce your issues?

Thank you.

---

<div class="post-metadata">

**Author:** ![stuart.forrest](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stuart.forrest/32/33282_2.png) [@stuart.forrest](https://community.auth0.com/u/stuart.forrest)\
**Post date:** [December 1, 2021, 1:14pm UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829/4 "2021-12-01T13:14:18Z")

</div>

I was being an idiot, repeatedly. You can ignore this 🙂

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 1, 2021, 2:45pm UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829/5 "2021-12-01T14:45:26Z")

</div>

Hi @stuart.forrest,

We’ve all been there. I’m glad everything is working now!

Please let me know if there’s anything else I can do to help.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 16, 2021, 2:45pm UTC](https://community.auth0.com/t/a-users-app-metadata-is-not-available-in-post-login-action-event/73829/6 "2021-12-16T14:45:56Z")

</div>

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