ordercloud-api / ordercloud-javascript-sdk

The official Javascript SDK for the OrderCloud eCommerce platform
MIT License
16 stars 15 forks source link

Type for DecodedToken.role is incorrect #76

Closed crhistianramirez closed 2 years ago

crhistianramirez commented 2 years ago

Its currently:

Array<SecurityProfile['Roles']> | SecurityProfile['Roles']

This amounts to either:

It should really be either an array of roles or a single role because if there is just one role then the JWT token just includes it as a string. And really since custom roles have been introduced to security profiles we should probably not limit the type to ApiRole and instead allow either a string[] or string