mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Fix renderLink()
This commit is contained in:
@ -1164,7 +1164,7 @@ export function getLoginLink(application) {
|
|||||||
let url;
|
let url;
|
||||||
if (application === null) {
|
if (application === null) {
|
||||||
url = null;
|
url = null;
|
||||||
} else if (!isPasswordEnabled(application) && window.location.pathname.includes("/auto-signup/oauth/authorize")) {
|
} else if (window.location.pathname.includes("/auto-signup/oauth/authorize")) {
|
||||||
url = window.location.href.replace("/auto-signup/oauth/authorize", "/login/oauth/authorize");
|
url = window.location.href.replace("/auto-signup/oauth/authorize", "/login/oauth/authorize");
|
||||||
} else if (authConfig.appName === application.name) {
|
} else if (authConfig.appName === application.name) {
|
||||||
url = "/login";
|
url = "/login";
|
||||||
@ -1176,11 +1176,6 @@ export function getLoginLink(application) {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderLoginLink(application, text) {
|
|
||||||
const url = getLoginLink(application);
|
|
||||||
return renderLink(url, text, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function redirectToLoginPage(application, history) {
|
export function redirectToLoginPage(application, history) {
|
||||||
const loginLink = getLoginLink(application);
|
const loginLink = getLoginLink(application);
|
||||||
if (loginLink.startsWith("http://") || loginLink.startsWith("https://")) {
|
if (loginLink.startsWith("http://") || loginLink.startsWith("https://")) {
|
||||||
@ -1205,7 +1200,7 @@ function renderLink(url, text, onClick) {
|
|||||||
);
|
);
|
||||||
} else if (url.startsWith("http")) {
|
} else if (url.startsWith("http")) {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" rel="noopener noreferrer" style={{float: "right"}} href={url} onClick={() => {
|
<a style={{float: "right"}} href={url} onClick={() => {
|
||||||
if (onClick !== null) {
|
if (onClick !== null) {
|
||||||
onClick();
|
onClick();
|
||||||
}
|
}
|
||||||
@ -1220,7 +1215,7 @@ export function renderSignupLink(application, text) {
|
|||||||
let url;
|
let url;
|
||||||
if (application === null) {
|
if (application === null) {
|
||||||
url = null;
|
url = null;
|
||||||
} else if (!isPasswordEnabled(application) && window.location.pathname.includes("/login/oauth/authorize")) {
|
} else if (window.location.pathname.includes("/login/oauth/authorize")) {
|
||||||
url = window.location.href.replace("/login/oauth/authorize", "/auto-signup/oauth/authorize");
|
url = window.location.href.replace("/login/oauth/authorize", "/auto-signup/oauth/authorize");
|
||||||
} else if (authConfig.appName === application.name) {
|
} else if (authConfig.appName === application.name) {
|
||||||
url = "/signup";
|
url = "/signup";
|
||||||
|
Reference in New Issue
Block a user