# Error on saving actions

**URL:** <https://community.auth0.com/t/error-on-saving-actions/77460>\
**Category:** Get Help\
**Tags:** actions\
**Created:** [February 2, 2022, 5:34am UTC](https://community.auth0.com/t/error-on-saving-actions/77460 "2022-02-02T05:34:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranshushah](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pranshushah/32/34583_2.png) [@pranshushah](https://community.auth0.com/u/pranshushah)\
**Post date:** [February 2, 2022, 5:34am UTC](https://community.auth0.com/t/error-on-saving-actions/77460/1 "2022-02-02T05:34:57Z")

</div>

I am trying to save action after changing data but it throwing me this error.

> Error!invalid Action.CurrentVersion: embedded message failed validation | caused by: invalid ActionVersion.SupportedTriggers: value must contain exactly 1 item(s)

before saving action

```auto
exports.onExecutePostLogin = async (event, api) => {
    const axios = require("axios");
    const app_metadata = event.user.app_metadata || {};
    if(event.connection.strategy === "google-oauth2" && event.stats && event.stats.logins_count === 1){
      api.user.setAppMetadata("number_of_identities",event.user.identities.length);
      await axios.post('https://b0d5-180-151-40-34.ngrok.io/api/adduser',{event,isSignup:true});
      return;
    }
    // new identity has been used 
    else if(app_metadata.number_of_identities + 1 === event.user.identities.length){
      api.user.setAppMetadata("number_of_identities",event.user.identities.length);
      await axios.post('https://b0d5-180-151-40-34.ngrok.io/api/adduser',{event,newProvider:true});
    }
    // we already sent the verification message but user have not verified it's email.
    if(event.connection.strategy === "auth0" && app_metadata["verification_email_sent"] && !event.user.email_verified){
      api.redirect.sendUserTo('https://b0d5-180-151-40-34.ngrok.io/please-verify-user');
  }
  // user has verified it's email so will our sync our changes in database.
  else if(event.connection.strategy === "auth0" && app_metadata["verification_email_sent"] && event.user.email_verified && !app_metadata["email_verfied_by_database"]){
    await axios.post('https://b0d5-180-151-40-34.ngrok.io/api/auth/email-verified-done',{event});
  }

};

```

```auto

exports.onExecutePostLogin = async (event, api) => {
  const axios = require("axios");
  const app_metadata = event.user.app_metadata || {};
  if(event.connection.strategy === "google-oauth2" && event.stats && event.stats.logins_count === 1){
    api.user.setAppMetadata("number_of_identities",event.user.identities.length);
    await axios.post('https://dd39-180-151-40-34.ngrok.io/api/adduser',{event,isSignup:true});
    return;
  }
  // new identity has been used 
  else if(app_metadata.number_of_identities + 1 === event.user.identities.length){
    api.user.setAppMetadata("number_of_identities",event.user.identities.length);
    await axios.post('https://dd39-180-151-40-34.ngrok.io/api/adduser',{event,newProvider:true});
  }
  // we already sent the verification message but user have not verified it's email.
  if(event.connection.strategy === "auth0" && app_metadata["verification_email_sent"] && !event.user.email_verified){
    api.redirect.sendUserTo('https://dd39-180-151-40-34.ngrok.io/please-verify-user');
  }
  // user has verified it's email so will our sync our changes in database.
  else if(event.connection.strategy === "auth0" && app_metadata["verification_email_sent"] && event.user.email_verified && !app_metadata["email_verfied_by_database"]){
    await axios.post('https://dd39-180-151-40-34.ngrok.io/api/auth/email-verified-done',{event});
  }

};

```

in-short I am only changing my ngrok URL in my code.

- old version of the code was working perfectly
- I tried to reload the tab.
- even after logging out and logging in it is throwing the same error.
- I also tried to save perfectly working code copied from action-history but it is still throwing the same error

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 3, 2022, 11:00pm UTC](https://community.auth0.com/t/error-on-saving-actions/77460/3 "2022-02-03T23:00:32Z")

</div>

Hi @pranshushah,

I was able to deploy both of those sets of code successfully.

Can you please try to create a new custom action? Make sure to preserve the header info in the action(e.g. `@param {Event} event` etc.).

If the issue persists can you please DM me your tenant name?

---

<div class="post-metadata">

**Author:** ![pranshushah](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pranshushah/32/34583_2.png) [@pranshushah](https://community.auth0.com/u/pranshushah)\
**Post date:** [February 4, 2022, 5:13pm UTC](https://community.auth0.com/t/error-on-saving-actions/77460/4 "2022-02-04T17:13:32Z")

</div>

so I revert back to the old version save and tried to make changes into that version with the same code and now it’s working 🤣

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 4, 2022, 10:24pm UTC](https://community.auth0.com/t/error-on-saving-actions/77460/5 "2022-02-04T22:24:19Z")

</div>

Hm…that is certainly odd. It could have been an issue with the browser cache, or something else. Hard to say.

If you are able to reliably repeat the issue please let me know and I will report it. Thanks!

---

<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:** [February 19, 2022, 10:25pm UTC](https://community.auth0.com/t/error-on-saving-actions/77460/6 "2022-02-19T22:25:15Z")

</div>

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