# Problems with 'Post User Registration' action

**URL:** <https://community.auth0.com/t/problems-with-post-user-registration-action/101314>\
**Category:** Get Help\
**Tags:** auth0-authorization, extensions\
**Created:** [February 26, 2023, 9:07pm UTC](https://community.auth0.com/t/problems-with-post-user-registration-action/101314 "2023-02-26T21:07:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clarotech](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/clarotech/32/37113_2.png) [@clarotech](https://community.auth0.com/u/clarotech)\
**Post date:** [February 26, 2023, 9:07pm UTC](https://community.auth0.com/t/problems-with-post-user-registration-action/101314/1 "2023-02-26T21:07:02Z")

</div>

I have set up two ‘flows’ each of which calls the same AWS lambda via an API Gateway.  
The ‘Login / Post Login’ flow works perfectly.

However, the ‘Post User Registration’ one does not. If I login ‘using Google’ Autho creates an entry in the user table but the action is not triggered. Is it meant to be?

If not, how do I catch the first login using a social login?

---

<div class="post-metadata">

**Author:** ![james.merrigan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.merrigan/32/44373_2.png) [@james.merrigan](https://community.auth0.com/u/james.merrigan)\
**Post date:** [February 27, 2023, 6:44am UTC](https://community.auth0.com/t/problems-with-post-user-registration-action/101314/3 "2023-02-27T06:44:10Z")

</div>

Hi @clarotech 👋

Thanks for reaching out on the Community!

The `Post User Registration` action will only run after a user has been created for a Database or Passwordless connection. You can find details on this restriction in the following documentation:

- [Post User Registration Action - Triggers](https://auth0.com/docs/customize/actions/flows-and-triggers/post-user-registration-flow#post-user-registration)

To achieve similar with a social connection, I would recommend leveraging a Post Login Action and checking against the number of logins and the connection type.

E.g. something along the lines of:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if (event.stats.logins_count === 1 && event.connection.name === CONNECTION_NAME) {
   // Do something here..
 }
};

```

You can find a full list of the properties exposed on the `event` object for the Post Login Action via the following link:

- [Post Login Action - Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object)

I hope this is helpful! Let me know how you get on.

---

<div class="post-metadata">

**Author:** ![clarotech](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/clarotech/32/37113_2.png) [@clarotech](https://community.auth0.com/u/clarotech)\
**Post date:** [February 27, 2023, 8:38am UTC](https://community.auth0.com/t/problems-with-post-user-registration-action/101314/4 "2023-02-27T08:38:46Z")

</div>

Thanks @james.merrigan your suggested approach is very similar to the one I implemented as a temporary workaround, looks like it might become permanent.

---

<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:** [March 13, 2023, 8:39am UTC](https://community.auth0.com/t/problems-with-post-user-registration-action/101314/5 "2023-03-13T08:39:32Z")

</div>

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