nhost-js-sdk icon indicating copy to clipboard operation
nhost-js-sdk copied to clipboard

[FEATURE REQUEST] User Role helper

Open go4cas opened this issue 3 years ago • 0 comments

The current SDK methods include a helper to get the user data (auth.user()). I would be great if we could get something similar for user roles. At present I can get this by calling auth.getClaim('x-hasura-allowed-roles'), but I think a helper would be more inline with the current design?

My use case: extracting user roles on the front-end to guard navigation routes, and show/hide features based on allowed roles.

go4cas avatar Mar 20 '21 10:03 go4cas