Commit 53172e0d authored by Florent Chehab's avatar Florent Chehab

fix(log out)

parent 20d21b13
Pipeline #44497 passed with stages
in 3 minutes and 49 seconds
### [Versions](https://material-ui.com/versions/) ### [Versions](https://material-ui.com/versions/)
## Next
###### *TBD*
- [bug fix] Logout working on mobile ([#150](https://gitlab.utc.fr/rex-dri/rex-dri/issues/150))
## v1.0.1 ## v1.0.1
###### *23 Aug 2019* ###### *23 Aug 2019*
......
...@@ -29,6 +29,7 @@ import PageMyExchanges from "../pages/PageMyExchanges"; ...@@ -29,6 +29,7 @@ import PageMyExchanges from "../pages/PageMyExchanges";
import NotifierImportantInformation from "./NotifierImportantInformation"; import NotifierImportantInformation from "./NotifierImportantInformation";
import FooterImportantInformation from "./FooterImportantInformation"; import FooterImportantInformation from "./FooterImportantInformation";
import PageAboutUnlinkedPartners from "../pages/PageAboutUnlinkedPartners"; import PageAboutUnlinkedPartners from "../pages/PageAboutUnlinkedPartners";
import PageLogout from "../pages/PageLogout";
// import PageFiles from "../pages/PageFiles"; // import PageFiles from "../pages/PageFiles";
/** /**
...@@ -59,6 +60,7 @@ class App extends CustomComponentForAPI { ...@@ -59,6 +60,7 @@ class App extends CustomComponentForAPI {
<Route path={APP_ROUTES.aboutRgpd} component={PageRgpd}/> <Route path={APP_ROUTES.aboutRgpd} component={PageRgpd}/>
<Route path={APP_ROUTES.aboutCgu} component={PageCgu}/> <Route path={APP_ROUTES.aboutCgu} component={PageCgu}/>
<Route path={APP_ROUTES.aboutUnlinkedPartners} component={PageAboutUnlinkedPartners}/> <Route path={APP_ROUTES.aboutUnlinkedPartners} component={PageAboutUnlinkedPartners}/>
<Route path={APP_ROUTES.logout} component={PageLogout}/>
<Route component={PageNotFound}/> <Route component={PageNotFound}/>
</Switch> </Switch>
</main> </main>
......
import React from "react";
import PropTypes from "prop-types";
import {APP_ROUTES} from "../../config/appRoutes";
import {Typography} from "@material-ui/core";
let _triggered = false;
/**
* Component to force user logout
*/
function PageLogout(props) {
if (!_triggered) {
_triggered = true;
props.history.push(APP_ROUTES.logout);
window.location.reload(); // need to reload otherwise it might not work on mobile
}
return <Typography variant={"caption"}>Déconnexion on cours...</Typography>;
}
PageLogout.propTypes = {
history: PropTypes.object.isRequired,
};
export default PageLogout;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment