Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identities with single group membership fail validation #219

Open
gcdurastanti opened this issue Aug 22, 2018 · 0 comments
Open

Identities with single group membership fail validation #219

gcdurastanti opened this issue Aug 22, 2018 · 0 comments

Comments

@gcdurastanti
Copy link

gcdurastanti commented Aug 22, 2018

The default rule added to the Auth0 tenant passes groups through. When there is only a single group associated with an identity it comes back as a string value instead of an Array and the API call fails because its expecting an Array.

This fixes it in the rule (which is my current workaround) but I suspect there is another issue somewhere in your API where these groups are returned that may be a better place for a fix.

      json: {
        connectionName: context.connection || user.identities[0].connection,
        groups: user.groups
        groups: Array.isArray(user.groups) ? user.groups : [ user.groups ]
      }

I also saw this in lib/queries.js which leads me to believe the groups are getting completely wiped out instead of reassigned to an Array?

      if (!Array.isArray(groupMemberships)) {
        groupMemberships = [ ];
      }

maybe needs to be...

      if (!Array.isArray(groupMemberships)) {
        groupMemberships = [ groupMemberships ];
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant