Skip to content

Commit

Permalink
Use authentication router error commons UI (#85)
Browse files Browse the repository at this point in the history
Signed-off-by: sBouzols <[email protected]>
  • Loading branch information
sBouzols authored Nov 8, 2022
1 parent 6f48673 commit 0dabd08
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@gridsuite/commons-ui": "0.27.2",
"@gridsuite/commons-ui": "0.28.0",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.75",
"@mui/material": "^5.5.3",
Expand Down
6 changes: 3 additions & 3 deletions src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ const App = () => {
const signInCallbackError = useSelector(
(state) => state.signInCallbackError
);
const unauthorizedUserInfo = useSelector(
(state) => state.unauthorizedUserInfo
const authenticationRouterError = useSelector(
(state) => state.authenticationRouterError
);
const showAuthenticationRouterLogin = useSelector(
(state) => state.showAuthenticationRouterLogin
Expand Down Expand Up @@ -311,7 +311,7 @@ const App = () => {
<AuthenticationRouter
userManager={userManager}
signInCallbackError={signInCallbackError}
unauthorizedUserInfo={unauthorizedUserInfo}
authenticationRouterError={authenticationRouterError}
showAuthenticationRouterLogin={
showAuthenticationRouterLogin
}
Expand Down
14 changes: 12 additions & 2 deletions src/redux/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
USER,
SIGNIN_CALLBACK_ERROR,
UNAUTHORIZED_USER_INFO,
LOGOUT_ERROR,
USER_VALIDATION_ERROR,
SHOW_AUTH_INFO_LOGIN,
} from '@gridsuite/commons-ui';
import { removeTime } from '../utils/rest-api';
Expand All @@ -48,7 +50,7 @@ const initialState = {
computedLanguage: getLocalStorageComputedLanguage(),
user: null,
signInCallbackError: null,
unauthorizedUserInfo: null,
authenticationRouterError: null,
showAuthenticationRouterLogin: false,
configs: [],
processes: [],
Expand Down Expand Up @@ -79,7 +81,15 @@ export const reducer = createReducer(initialState, {
},

[UNAUTHORIZED_USER_INFO]: (state, action) => {
state.unauthorizedUserInfo = action.unauthorizedUserInfo;
state.authenticationRouterError = action.authenticationRouterError;
},

[LOGOUT_ERROR]: (state, action) => {
state.authenticationRouterError = action.authenticationRouterError;
},

[USER_VALIDATION_ERROR]: (state, action) => {
state.authenticationRouterError = action.authenticationRouterError;
},

[SHOW_AUTH_INFO_LOGIN]: (state, action) => {
Expand Down

0 comments on commit 0dabd08

Please sign in to comment.