We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fe465a commit 1b4c263Copy full SHA for 1b4c263
1 file changed
EXAMPLES.md
@@ -326,18 +326,18 @@ In order to protect a route with a claims check alongside an authentication requ
326
327
```jsx
328
const withClaimCheck = (Component, myClaimCheckFunction, returnTo) => {
329
- const { user } = useAuth0();
+ const { user } = useAuth0();
330
if (myClaimCheckFunction(user)) {
331
- return <Component />;
+ return <Component />
332
}
333
Router.push(returnTo);
334
-};
+}
335
336
const checkClaims = (claim?: User) => claim?.['https://my.app.io/jwt/claims']?.ROLE?.includes('ADMIN');
337
338
// Usage
339
const Page = withAuthenticationRequired(
340
- withClaimCheck(Component, checkClaims, '/missing-roles')
+ withClaimCheck(Component, checkClaims, '/missing-roles' )
341
);
342
```
343
0 commit comments