File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -326,18 +326,18 @@ In order to protect a route with a claims check alongside an authentication requ
326326
327327` ` ` jsx
328328const withClaimCheck = (Component , myClaimCheckFunction , returnTo ) => {
329- const { user } = useAuth0 ();
329+ const { user } = useAuth0 ();
330330 if (myClaimCheckFunction (user)) {
331- return < Component / > ;
331+ return < Component / >
332332 }
333333 Router .push (returnTo);
334- };
334+ }
335335
336336const checkClaims = (claim ?: User ) => claim? .[' https://my.app.io/jwt/claims' ]? .ROLE ? .includes (' ADMIN' );
337337
338338// Usage
339339const Page = withAuthenticationRequired (
340- withClaimCheck (Component, checkClaims, ' /missing-roles' )
340+ withClaimCheck (Component, checkClaims, ' /missing-roles' )
341341);
342342` ` `
343343
You can’t perform that action at this time.
0 commit comments