mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
chore: bypass 404 page
This commit is contained in:
@@ -74,6 +74,8 @@ const MainDrawer = ({
|
||||
|
||||
const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`;
|
||||
|
||||
const isPathnameNotFoundPage = formattedPathname === '/404/';
|
||||
|
||||
const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) =>
|
||||
permissionCheck(permission)
|
||||
);
|
||||
@@ -82,10 +84,14 @@ const MainDrawer = ({
|
||||
setMainDrawerOpen(!mainDrawerOpen);
|
||||
};
|
||||
|
||||
if (!isPermitted) {
|
||||
if (!isPermitted && !isPathnameNotFoundPage) {
|
||||
return <PermissionNotFound />;
|
||||
}
|
||||
|
||||
if (isPathnameNotFoundPage) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
open={mainDrawerOpen}
|
||||
|
||||
Reference in New Issue
Block a user