Revert "CEC-2977 Filter portal access based on auth provider (#231)"

This reverts commit f2f046968e.
This commit is contained in:
jwu-fisker
2022-11-08 16:49:10 -08:00
parent f2f046968e
commit 33bfc4fb13
76 changed files with 912 additions and 1316 deletions

View File

@@ -8,7 +8,7 @@ export const TYPES = {
PROTECTED: 2,
};
export const AuthRoute = ({ token, type, groups, rolesPerGroup, providers, ...others }) => {
export const AuthRoute = ({ token, type, roles, groups, ...others }) => {
if (type === TYPES.PROTECTED && !token) {
return <Redirect to="/" />;
} else if (type === TYPES.GUEST && token) {
@@ -16,9 +16,8 @@ export const AuthRoute = ({ token, type, groups, rolesPerGroup, providers, ...ot
} else if (
type === TYPES.PROTECTED &&
token &&
rolesPerGroup &&
providers &&
!hasRole(groups, rolesPerGroup, providers)
roles &&
!hasRole(roles, groups)
) {
return <Redirect to="/home" />;
}