# Post-registration action works in testing but not when deployed

**URL:** <https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191>\
**Category:** Get Help\
**Tags:** linkedin, auth0\
**Created:** [February 13, 2022, 5:10pm UTC](https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191 "2022-02-13T17:10:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourcing](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sourcing/32/25248_2.png) [@sourcing](https://community.auth0.com/u/sourcing)\
**Post date:** [February 13, 2022, 5:10pm UTC](https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191/1 "2022-02-13T17:10:46Z")

</div>

I’m using LinkedIn Social / OAuth login to register and sign-in users with Auth0. On their first log-in (registration) I want an action to create a “user” object/document in FaunaDB using the Auth0 “event.user” JSON object that was created from the data passed by LinkedIn. I wrote the script for it in the action’s part of post-registration-flow, tested it with the FaunaDB secret key (it worked great), deployed it, set up the action flow, and it’s just not passing the new user’s info to FaunaDB after a user’s first login using LinkedIn Social Sign In.

Is there an error log for actions that I can view? Is LinkedIn social login technically not considered a registration even though user member is created in Auth0’s “User Management” tab? Am I messing up the Auth0 Actions configuration? I’d greatly appreciate any insight. Thanks so much, everyone!

```auto
/**
* Handler that will be called during the execution of a PostUserRegistration flow.
*
* @param {Event} event - Details about the context and user that has registered.
*/
const axios = require('axios');

exports.onExecutePostUserRegistration = async (event) => {

  const given_name = event.user.given_name;
  const family_name = event.user.family_name;
  const nickname = event.user.nickname;
  const name = event.user.name;
  const picture = event.user.picture;
  const updated_at = event.user.updated_at;
  const email = event.user.email;
  const emailed_verified = event.user.emailed_verified;
  const sub = event.user.user_id;
  const variables = { given_name, family_name, nickname, name, picture, updated_at, email, emailed_verified, sub };
  
  const CREATE_USER = `
    mutation(
      $given_name: String, 
      $family_name: String, 
      $nickname: String, 
      $name: String, 
      $picture: String, 
      $updated_at: String, 
      $email: String, 
      $emailed_verified: Boolean, 
      $sub: String) {
      
      createUser(
        data: {
          given_name: $given_name,
          family_name: $family_name,
          nickname: $nickname,
          name: $name,
          picture: $picture,
          updated_at: $updated_at,
          email: $email,
          emailed_verified: $emailed_verified,
          sub: $sub
        }
      ) {
        _id
        _ts
      }
    }
  `
  const sendQuery = async (query, variables) => {
  const {
    data: { data, errors },
  } = await axios({
    url: 'https://graphql.us.fauna.com/graphql',
    method: 'POST',
    headers: {
      Authorization: `Bearer ${event.secrets.FAUNA_SECRET_KEY}`,
    },
    data: {
      query,
      variables,
    },
  });
  if (errors) {
      console.error(errors);
      throw new Error('Something went wrong on sendQuery');
  }
  return data;
};

  const formattedResponse = (statusCode, body) => {
      return {
          statusCode,
          body: JSON.stringify(body),
      };
  };

  try {
      const { createUser } = await sendQuery(
          CREATE_USER, 
          variables
      );

      return formattedResponse(200, createUser);
  } catch (err) {
      console.error(err);
      return formattedResponse(500, { err: 'There was an error in creating a new user.' });
  }

};

```

---

<div class="post-metadata">

**Author:** ![sourcing](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sourcing/32/25248_2.png) [@sourcing](https://community.auth0.com/u/sourcing)\
**Post date:** [February 13, 2022, 6:07pm UTC](https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191/2 "2022-02-13T18:07:36Z")

</div>

Should have searched the community first. Social/enterprise logins don’t count trigger actions as per this thread:

[https://community.auth0.com/t/post-user-registration-trigger-for-actions-not-called/70262/3](https://community.auth0.com/t/post-user-registration-trigger-for-actions-not-called/70262/3)

I do wish this counted as registration since a new member is created in the “User Management” tab in Auth0. Is there a technical or user requirement reason why it’s not?

Please mark this thread as resolved. Thanks everyone.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 14, 2022, 8:24am UTC](https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191/3 "2022-02-14T08:24:00Z")

</div>

Not sure about. Gonna find out with the team but thanks for sharing the solution with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 22, 2022, 2:42pm UTC](https://community.auth0.com/t/post-registration-action-works-in-testing-but-not-when-deployed/78191/4 "2022-02-22T14:42:46Z")

</div>


