From 2cc5e82d9119783fca464f28ca2ed38d1ffba3f0 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Tue, 1 Apr 2025 00:57:24 +0800 Subject: [PATCH] feat: support login button loading state (#3694) --- web/src/auth/LoginPage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index 5549851a..9b907b05 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -63,6 +63,7 @@ class LoginPage extends React.Component { termsOfUseContent: "", orgChoiceMode: new URLSearchParams(props.location?.search).get("orgChoiceMode") ?? null, userLang: null, + loginLoading: false, }; if (this.state.type === "cas" && props.match?.params.casApplicationName !== undefined) { @@ -423,6 +424,7 @@ class LoginPage extends React.Component { } login(values) { + this.setState({loginLoading: true}); // here we are supposed to determine whether Casdoor is working as an OAuth server or CAS server values["language"] = this.state.userLang ?? ""; if (this.state.type === "cas") { @@ -452,6 +454,7 @@ class LoginPage extends React.Component { } else { Setting.showMessage("error", `${i18next.t("application:Failed to sign in")}: ${res.msg}`); } + this.setState({loginLoading: false}); }); } else { // OAuth @@ -507,6 +510,7 @@ class LoginPage extends React.Component { } else { Setting.showMessage("error", `${i18next.t("application:Failed to sign in")}: ${res.msg}`); } + this.setState({loginLoading: false}); }); } } @@ -694,6 +698,7 @@ class LoginPage extends React.Component {
" + signinItem.customCss?.replaceAll("", "") + "")}} />