# Is onExecutePostLogin being called more than once?

**URL:** <https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [October 10, 2025, 4:43pm UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052 "2025-10-10T16:43:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [October 10, 2025, 4:43pm UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052/1 "2025-10-10T16:43:05Z")

</div>

We have a weird scenario whereby it _seems_ (there are other possible explanations) like `onExecutePostLogin` is being called multiple times.

We use this hook to call an endpoint in our app which sends a (home-brewed) 2FA SMS to the user. But for SOME (not all, which is worse) users they’re being sent lots and lots of 2FA messages.

There is no loop in my endpoint. So our current suspicion is that they’re stuck in a loop whereby `onExecutePostLogin` is somehow being called repeatedly as part of the same login flow.

Is this feasible as an explanation, or am I way off?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [October 13, 2025, 10:30am UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052/3 "2025-10-13T10:30:24Z")

</div>

Anyone able to help me here?

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [October 28, 2025, 5:42pm UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052/5 "2025-10-28T17:42:48Z")

</div>

Hi @kkrp1,

Apologies for the late reply. The `onExecutePostLogin` hook itself is almost certainly not running multiple times for a single login event. The `onExecutePostLogin` trigger is designed to run exactly once after a user successfully authenticates and _before_ they are redirected back to your application.

Instead, likely, your application is accidentally triggering multiple, distinct login events in a rapid loop, and the hook is correctly executing once for each of those events.

The most common cause for the behavior you’re seeing is a **redirect loop**

If you have any further questions, please don’t hesitate to reach out.

Have a good one,  
Vlad

---

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [October 31, 2025, 11:04am UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052/6 "2025-10-31T11:04:18Z")

</div>

Thank you. You were right. But this hook _does_ seem to be called when Auth0 silently tries to fetch a new token, which is what was confusing me. I had assumed it was called only on a literal, manual login. These two things can be differentiated, it seems, via the `evt.request.query?.prompt` property, which is either “login” or “none”.

---

<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:** [November 14, 2025, 11:04am UTC](https://community.auth0.com/t/is-onexecutepostlogin-being-called-more-than-once/193052/7 "2025-11-14T11:04:39Z")

</div>

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