Skip to content

Identities with single group membership fail validation #219

@gcdurastanti

Description

@gcdurastanti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions