}
public getTargetURL() {
- return this.getStorage().getItem(TARGET_URL);
+ return this.getStorage().getItem(TARGET_URL);
}
public removeApiToken() {
public login(uuidPrefix: string, homeCluster: string, loginCluster: string, remoteHosts: { [key: string]: string }) {
const currentUrl = `${window.location.protocol}//${window.location.host}/token`;
const homeClusterHost = remoteHosts[homeCluster];
- this.getStorage().setItem(TARGET_URL, window.location.href);
+ const rd = new URL(window.location.href);
+ this.getStorage().setItem(TARGET_URL, rd.pathname + rd.search);
window.location.assign(`https://${homeClusterHost}/login?${(uuidPrefix !== homeCluster && homeCluster !== loginCluster) ? "remote=" + uuidPrefix + "&" : ""}return_to=${currentUrl}`);
}
import { navigateToRootProject, navigateToLinkAccount } from "~/store/navigation/navigation-action";
import { Config } from "~/common/config";
import { getAccountLinkData } from "~/store/link-account-panel/link-account-panel-actions";
+import { replace } from "react-router-redux";
interface ApiTokenProps {
authService: AuthService;
this.props.dispatch<any>(saveApiToken(apiToken)).finally(() => {
const redirectURL = this.props.authService.getTargetURL();
- if (redirectURL) {
- this.props.authService.removeTargetURL();
- window.location.href = redirectURL;
- }
- else if (loadMainApp) {
- if (this.props.dispatch(getAccountLinkData())) {
+ if (loadMainApp) {
+ if (redirectURL) {
+ this.props.authService.removeTargetURL();
+ this.props.dispatch(replace(redirectURL));
+ }
+ else if (this.props.dispatch(getAccountLinkData())) {
this.props.dispatch(navigateToLinkAccount);
}
else {