Skip to content

Commit

Permalink
fix(ui): login don't redirect correctly with context-path (#1355)
Browse files Browse the repository at this point in the history
close #907
  • Loading branch information
AlexisSouquiere authored and tchiotludo committed Apr 4, 2023
1 parent 336c293 commit bd281de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/components/Root/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ class Root extends Component {
cancel = axios.CancelToken.source();

componentWillUnmount() {
const pathname = window.location.pathname;
/* eslint-disable react/prop-types */
const pathname = this.props.location?.pathname;

if (pathname !== '/ui/login') {
if (pathname && pathname !== '/ui/login') {
sessionStorage.setItem('returnTo', pathname + (window.location.search || ''));
}

Expand Down

0 comments on commit bd281de

Please sign in to comment.