Skip to content

Commit

Permalink
HPCC-30934 ECL Watch v9 fix unlock page redirect
Browse files Browse the repository at this point in the history
redirect to the last visited page instead of always going to "/index.html"

Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Nov 28, 2023
1 parent 92bba5b commit d43eda8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion esp/src/src-react/components/forms/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export const Login: React.FunctionComponent<LoginProps> = ({
cookies["ESPAuthenticated"] = "true";
createUserSession(cookies).then(() => {
setErrorMessage("");
replaceUrl("/", true);
const lastUrl = window.localStorage.getItem("pageOnLock") ?? "/";
window.localStorage.removeItem("pageOnLock");
replaceUrl(lastUrl, true);
}).catch(err => logger.error("Unable to create user session."));
}
}
Expand Down

0 comments on commit d43eda8

Please sign in to comment.