Skip to content

Commit

Permalink
redirect to keycloak on new service (#158)
Browse files Browse the repository at this point in the history
Co-authored-by: Donatien Eneman <[email protected]>
  • Loading branch information
Donatien26 and Donatien26 authored Jul 1, 2020
1 parent 950d429 commit a1106b9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { axiosPublic, fromUser, filterOnglets } from 'js/utils';
import api from 'js/redux/api';
import { getVaultToken } from 'js/vault-client';
import useBetaTest from 'js/components/hooks/useBetaTest';
import { getKeycloak } from 'js/utils';

const NouveauService = ({
idCatalogue,
Expand Down Expand Up @@ -62,6 +63,12 @@ const NouveauService = ({
[creerNouveauService, service, idCatalogue, fieldsValues, contract]
);

useEffect(() => {
if (!authenticated) {
getKeycloak().login();
}
}, [authenticated]);

useEffect(() => {
if (authenticated) {
getService(idCatalogue, idService).then((res) => {
Expand Down

0 comments on commit a1106b9

Please sign in to comment.