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
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});
}
};
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