# Remove attributes from user rule template migration to login flow action script not working

**URL:** <https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788>\
**Category:** Get Help\
**Tags:** custom-webtasks, deprecations\
**Created:** [June 22, 2023, 5:08pm UTC](https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788 "2023-06-22T17:08:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.sanigar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/richard.sanigar/32/23147_2.png) [@richard.sanigar](https://community.auth0.com/u/richard.sanigar)\
**Post date:** [June 22, 2023, 5:08pm UTC](https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788/1 "2023-06-22T17:08:31Z")

</div>

Hi Auth0 Community

I successfully created a rule based on the **Remove attributes from user** template

```auto
function removeUserAttribute(user, context, callback) {
  const blacklist = ['nickname','picture'];

  Object.keys(user).forEach(function (key) {
    if (blacklist.indexOf(key) > -1) {
      delete user[key];
    }
  });

  callback(null, user, context);
}

```

I migrated the code to a Login Flow action script.

```auto
exports.onExecutePostLogin = async (event, api) => {
  const blacklist = ['nickname','picture'];

  Object.keys(event.user).forEach(function (key) {
    if (blacklist.indexOf(key) > -1) {
      delete event.user[key]; 
    }
  });

  return;

};

```

The rule works, but the action script doesn’t. What have I done wrong?

Kind regards

Richard

---

<div class="post-metadata">

**Author:** ![richard.sanigar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/richard.sanigar/32/23147_2.png) [@richard.sanigar](https://community.auth0.com/u/richard.sanigar)\
**Post date:** [June 27, 2023, 5:40pm UTC](https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788/2 "2023-06-27T17:40:39Z")

</div>

Hi All

I created a support ticket and received this response.

_It’s currently not possible to remove claims from the ID token using actions. It’s on our roadmap to close this parity gap but it likely won’t be supported until later next year._

So I will keep the working rule and be patient 😁

Regards

Richard

---

<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:** [July 7, 2023, 8:40am UTC](https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788/3 "2023-07-07T08:40:30Z")

</div>

Thanks for sharing it 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:** [July 7, 2023, 8:40am UTC](https://community.auth0.com/t/remove-attributes-from-user-rule-template-migration-to-login-flow-action-script-not-working/109788/4 "2023-07-07T08:40:33Z")

</div>


