nhost-js-sdk
nhost-js-sdk copied to clipboard
[FEATURE REQUEST] User Role helper
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.