Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React component to perform access control for frontend components #241

Open
pavinduLakshan opened this issue Aug 7, 2024 · 0 comments
Open
Labels
enhancement New feature or request Type/New Feature

Comments

@pavinduLakshan
Copy link
Contributor

Is your suggestion related to an experience ? Please describe.

It'd be great to have a readymade utility function/component to perform access control on ui components in a react app.

Describe the improvement

The Component will only be displayed If the authenticated user has the scopes specified.

import { Show } from "@asgardeo/auth-react";

const App = () => {
 
  return (
  	  <>
			<Show requiredScopes={ [ /* array of required scopes */] }>
            	<Component ...props />
             </Show>
      </>
   )
}

Additional context

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Type/New Feature
Projects
None yet
Development

No branches or pull requests

1 participant