mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-14 08:03:23 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
7481b229a4 | |||
39e485ae82 | |||
764c64e67c | |||
e755a7331d | |||
6d9d595f86 | |||
d52058d2ae | |||
bcfbfc6947 |
@ -223,7 +223,7 @@ func extendApplicationWithSigninItems(application *Application) (err error) {
|
||||
Visible: true,
|
||||
Label: "\n<style>\n .login-logo-box {\n }\n<style>\n",
|
||||
Placeholder: "",
|
||||
Rule: "none",
|
||||
Rule: "None",
|
||||
}
|
||||
application.SigninItems = append(application.SigninItems, signinItem)
|
||||
signinItem = &SigninItem{
|
||||
|
@ -876,7 +876,7 @@ class ProviderEditPage extends React.Component {
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{["Custom HTTP SMS", "MinIO", "Google Cloud Storage", "Qiniu Cloud Kodo", "Synology"].includes(this.state.provider.type) ? null : (
|
||||
{["Custom HTTP SMS", "Google Cloud Storage", "Qiniu Cloud Kodo", "Synology"].includes(this.state.provider.type) ? null : (
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={2}>
|
||||
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :
|
||||
|
@ -1164,7 +1164,7 @@ export function getLoginLink(application) {
|
||||
let url;
|
||||
if (application === 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");
|
||||
} else if (authConfig.appName === application.name) {
|
||||
url = "/login";
|
||||
@ -1176,11 +1176,6 @@ export function getLoginLink(application) {
|
||||
return url;
|
||||
}
|
||||
|
||||
export function renderLoginLink(application, text) {
|
||||
const url = getLoginLink(application);
|
||||
return renderLink(url, text, null);
|
||||
}
|
||||
|
||||
export function redirectToLoginPage(application, history) {
|
||||
const loginLink = getLoginLink(application);
|
||||
if (loginLink.startsWith("http://") || loginLink.startsWith("https://")) {
|
||||
@ -1205,7 +1200,7 @@ function renderLink(url, text, onClick) {
|
||||
);
|
||||
} else if (url.startsWith("http")) {
|
||||
return (
|
||||
<a target="_blank" rel="noopener noreferrer" style={{float: "right"}} href={url} onClick={() => {
|
||||
<a style={{float: "right"}} href={url} onClick={() => {
|
||||
if (onClick !== null) {
|
||||
onClick();
|
||||
}
|
||||
@ -1220,7 +1215,7 @@ export function renderSignupLink(application, text) {
|
||||
let url;
|
||||
if (application === 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");
|
||||
} else if (authConfig.appName === application.name) {
|
||||
url = "/signup";
|
||||
@ -1253,7 +1248,11 @@ export function renderForgetLink(application, text) {
|
||||
}
|
||||
}
|
||||
|
||||
return renderLink(url, text, null);
|
||||
const storeSigninUrl = () => {
|
||||
sessionStorage.setItem("signinUrl", window.location.href);
|
||||
};
|
||||
|
||||
return renderLink(url, text, storeSigninUrl);
|
||||
}
|
||||
|
||||
export function renderHelmet(application) {
|
||||
|
@ -47,6 +47,7 @@ class ForgetPage extends React.Component {
|
||||
|
||||
this.form = React.createRef();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (this.getApplicationObj() === undefined) {
|
||||
if (this.state.applicationName !== undefined) {
|
||||
@ -153,7 +154,12 @@ class ForgetPage extends React.Component {
|
||||
values.userOwner = this.getApplicationObj()?.organizationObj.name;
|
||||
UserBackend.setPassword(values.userOwner, values.username, "", values?.newPassword, this.state.code).then(res => {
|
||||
if (res.status === "ok") {
|
||||
Setting.redirectToLoginPage(this.getApplicationObj(), this.props.history);
|
||||
const linkInStorage = sessionStorage.getItem("signinUrl");
|
||||
if (linkInStorage !== null && linkInStorage !== "") {
|
||||
Setting.goToLink(linkInStorage);
|
||||
} else {
|
||||
Setting.redirectToLoginPage(this.getApplicationObj(), this.props.history);
|
||||
}
|
||||
} else {
|
||||
Setting.showMessage("error", res.msg);
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ class LoginPage extends React.Component {
|
||||
);
|
||||
} else if (signinItem.name === "Providers") {
|
||||
const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application) || Setting.isLdapEnabled(application);
|
||||
if (signinItem.rule === "None") {
|
||||
if (signinItem.rule === "None" || signinItem.rule === "") {
|
||||
signinItem.rule = showForm ? "small" : "big";
|
||||
}
|
||||
|
||||
@ -782,7 +782,9 @@ class LoginPage extends React.Component {
|
||||
:
|
||||
</div>
|
||||
<br />
|
||||
{application.signinItems.map(signinItem => signinItem.name === "ThirdParty" || signinItem.name === "Footer" ? this.renderFormItem(application, signinItem) : null)}
|
||||
{
|
||||
application?.signinItems.map(signinItem => signinItem.name === "Providers" || signinItem.name === "Signup link" ? this.renderFormItem(application, signinItem) : null)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ class SigninTable extends React.Component {
|
||||
/>
|
||||
</div>
|
||||
} title={i18next.t("application:CSS style")} trigger="click">
|
||||
<Input value={text} style={{marginBottom: "10px"}} onChange={e => {
|
||||
<Input value={text} onChange={e => {
|
||||
this.updateField(table, index, "label", e.target.value);
|
||||
}} />
|
||||
</Popover>
|
||||
@ -229,7 +229,7 @@ class SigninTable extends React.Component {
|
||||
width: "155px",
|
||||
render: (text, record, index) => {
|
||||
let options = [];
|
||||
if (record.name === "ThirdParty") {
|
||||
if (record.name === "Providers") {
|
||||
options = [
|
||||
{id: "big", name: i18next.t("application:Big icon")},
|
||||
{id: "small", name: i18next.t("application:Small icon")},
|
||||
|
Reference in New Issue
Block a user