Skip to content

AccessTokenResolver validateToken withRolesAndPermissions fails to add roles and permissions #195

Description

@dan-foresight

Lines 53 through 58 in access-token-resolver.ts has what appears to be a bug. The entity without roles and permissions is listed to the right in the spread operator compared to the result of this.getEntity(entity) (which has the roles and permissions). This causes the result to NOT have the roles and permissions.

return { ...(entityWithRoles || ( options?.withRolesAndPermissions ? await this.getEntity(entity) : {} )), ...entity };

I've tested the following code which seems to work:

return { ...entity, ...(entityWithRoles || ( options?.withRolesAndPermissions ? await this.getEntity(entity) : {} )) };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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