mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-08 04:00:51 +08:00
@@ -901,11 +901,9 @@ class UserEditPage extends React.Component {
|
|||||||
</Space>
|
</Space>
|
||||||
{item.enabled ? (
|
{item.enabled ? (
|
||||||
<Space>
|
<Space>
|
||||||
{item.enabled ?
|
|
||||||
<Tag icon={<CheckCircleOutlined />} color="success">
|
<Tag icon={<CheckCircleOutlined />} color="success">
|
||||||
{i18next.t("general:Enabled")}
|
{i18next.t("general:Enabled")}
|
||||||
</Tag> : null
|
</Tag>
|
||||||
}
|
|
||||||
{item.isPreferred ?
|
{item.isPreferred ?
|
||||||
<Tag icon={<CheckCircleOutlined />} color="blue" style={{marginRight: 20}} >
|
<Tag icon={<CheckCircleOutlined />} color="blue" style={{marginRight: 20}} >
|
||||||
{i18next.t("mfa:preferred")}
|
{i18next.t("mfa:preferred")}
|
||||||
@@ -927,18 +925,23 @@ class UserEditPage extends React.Component {
|
|||||||
{i18next.t("mfa:Set preferred")}
|
{i18next.t("mfa:Set preferred")}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
|
{this.isSelf() ? <Button type={"default"} onClick={() => {
|
||||||
|
this.props.history.push(`/mfa/setup?mfaType=${item.mfaType}`);
|
||||||
|
}}>
|
||||||
|
{i18next.t("general:Edit")}
|
||||||
|
</Button> : null}
|
||||||
</Space>
|
</Space>
|
||||||
) :
|
) :
|
||||||
<Space>
|
<Space>
|
||||||
{item.mfaType !== TotpMfaType && Setting.isAdminUser(this.props.account) && window.location.href.indexOf("/users") !== -1 ?
|
{item.mfaType !== TotpMfaType && Setting.isLocalAdminUser(this.props.account) && !this.isSelf() ?
|
||||||
<EnableMfaModal user={this.state.user} mfaType={item.mfaType} onSuccess={() => {
|
<EnableMfaModal user={this.state.user} mfaType={item.mfaType} onSuccess={() => {
|
||||||
this.getUser();
|
this.getUser();
|
||||||
}} /> : null}
|
}} /> : null}
|
||||||
<Button type={"default"} onClick={() => {
|
{this.isSelf() ? <Button type={"default"} onClick={() => {
|
||||||
this.props.history.push(`/mfa/setup?mfaType=${item.mfaType}`);
|
this.props.history.push(`/mfa/setup?mfaType=${item.mfaType}`);
|
||||||
}}>
|
}}>
|
||||||
{i18next.t("mfa:Setup")}
|
{i18next.t("mfa:Setup")}
|
||||||
</Button>
|
</Button> : null}
|
||||||
</Space>}
|
</Space>}
|
||||||
</List.Item>
|
</List.Item>
|
||||||
)}
|
)}
|
||||||
|
@@ -98,7 +98,7 @@ class MfaSetupPage extends React.Component {
|
|||||||
|
|
||||||
renderMfaTypeSwitch() {
|
renderMfaTypeSwitch() {
|
||||||
const renderSmsLink = () => {
|
const renderSmsLink = () => {
|
||||||
if (this.state.mfaType === SmsMfaType || this.props.account.mfaPhoneEnabled) {
|
if (this.state.mfaType === SmsMfaType) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (<Button type={"link"} onClick={() => {
|
return (<Button type={"link"} onClick={() => {
|
||||||
@@ -112,7 +112,7 @@ class MfaSetupPage extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderEmailLink = () => {
|
const renderEmailLink = () => {
|
||||||
if (this.state.mfaType === EmailMfaType || this.props.account.mfaEmailEnabled) {
|
if (this.state.mfaType === EmailMfaType) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (<Button type={"link"} onClick={() => {
|
return (<Button type={"link"} onClick={() => {
|
||||||
@@ -126,7 +126,7 @@ class MfaSetupPage extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderTotpLink = () => {
|
const renderTotpLink = () => {
|
||||||
if (this.state.mfaType === TotpMfaType || this.props.account.totpSecret !== "") {
|
if (this.state.mfaType === TotpMfaType) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (<Button type={"link"} onClick={() => {
|
return (<Button type={"link"} onClick={() => {
|
||||||
@@ -191,7 +191,9 @@ class MfaSetupPage extends React.Component {
|
|||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
Setting.showMessage("success", i18next.t("general:Enabled successfully"));
|
Setting.showMessage("success", i18next.t("general:Enabled successfully"));
|
||||||
this.props.onfinish();
|
this.props.onfinish();
|
||||||
if (localStorage.getItem("mfaRedirectUrl") !== null) {
|
|
||||||
|
const mfaRedirectUrl = localStorage.getItem("mfaRedirectUrl");
|
||||||
|
if (mfaRedirectUrl !== undefined && mfaRedirectUrl !== null) {
|
||||||
Setting.goToLink(localStorage.getItem("mfaRedirectUrl"));
|
Setting.goToLink(localStorage.getItem("mfaRedirectUrl"));
|
||||||
localStorage.removeItem("mfaRedirectUrl");
|
localStorage.removeItem("mfaRedirectUrl");
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user