CEC-3119 Magna access (#235)

* CEC-3119 Magna access

* Clean up

* Update test provider
This commit is contained in:
John Wu
2022-11-14 13:30:57 -08:00
committed by GitHub
parent 33bfc4fb13
commit b7e13382c4
76 changed files with 1316 additions and 918 deletions

View File

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