diff --git a/src/pages/Authorized.tsx b/src/pages/Authorized.tsx index 9951b11e70ae6c5dc40ebf0c985290565b585097..8de52d42ccea89b2d0b9809e8e519d9c57b140ce 100644 --- a/src/pages/Authorized.tsx +++ b/src/pages/Authorized.tsx @@ -14,7 +14,10 @@ const getRouteAuthority = (path: string, routeData: Route[]) => { routeData.forEach(route => { // match prefix if (pathToRegexp(`${route.path}(.*)`).test(path)) { - authorities = route.authority || authorities; + // exact match + if (route.path === path) { + authorities = route.authority || authorities; + } // get children authority recursively if (route.routes) { authorities = getRouteAuthority(path, route.routes) || authorities;