Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-31841 ECL Watch v9 redirect to intended url after login #18741

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions esp/src/Login.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
function (ready, nlsHPCCMod) {
var nlsHPCC = nlsHPCCMod.default;
ready(function () {
window.localStorage.setItem("redirectAfterLogin", window.location.hash);

var loginStr = document.getElementById("loginStr");
var error = document.getElementById("hidden_msg");
var disabled = document.getElementById('disabled_msg');
Expand Down
7 changes: 6 additions & 1 deletion esp/src/src/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SMCService } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
import { cookieKeyValStore, sessionKeyValStore, userKeyValStore } from "src/KeyValStore";
import { singletonDebounce } from "../src-react/util/throttle";
import { parseSearch } from "../src-react/util/history";
import { parseSearch, replaceUrl } from "../src-react/util/history";
import { ModernMode } from "./BuildInfo";
import * as ESPUtil from "./ESPUtil";

Expand Down Expand Up @@ -135,6 +135,11 @@ export function formatCost(value): string {
export function initSession() {
if (sessionIsActive > -1) {

const redirectUrl = window.localStorage.getItem("redirectAfterLogin") ?? "";
if (redirectUrl) {
window.localStorage.removeItem("redirectAfterLogin");
replaceUrl(redirectUrl);
}
idleWatcher.on("active", function () {
resetESPTime();
});
Expand Down
Loading