feat: fix the issue of jumping back to the login page after resetting password (#1288)

* fix: redirect to login page

* fix: front end router

* fix: front end router

* fix: signup page router

* fix: redirect to login page
This commit is contained in:
Chell
2022-11-13 05:16:49 +01:00
committed by GitHub
parent d542208eb8
commit 61c2fd5412
5 changed files with 17 additions and 14 deletions

View File

@ -13,7 +13,7 @@
// limitations under the License.
import React from "react";
import {Link, useHistory} from "react-router-dom";
import {Link} from "react-router-dom";
import {Tag, Tooltip, message} from "antd";
import {QuestionCircleTwoTone} from "@ant-design/icons";
import {isMobile as isMobileDevice} from "react-device-detect";
@ -752,7 +752,7 @@ export function getLoginLink(application) {
} else if (authConfig.appName === application.name) {
url = "/login";
} else if (application.signinUrl === "") {
url = path.join(application.homepageUrl, "login");
url = path.join(application.homepageUrl, "/login");
} else {
url = application.signinUrl;
}
@ -764,9 +764,8 @@ export function renderLoginLink(application, text) {
return renderLink(url, text, null);
}
export function redirectToLoginPage(application) {
export function redirectToLoginPage(application, history) {
const loginLink = getLoginLink(application);
const history = useHistory();
history.push(loginLink);
}