From 1732cd85384d6999ba460048d1ed0eaeba7a561b Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Fri, 27 Oct 2023 00:06:17 +0800 Subject: [PATCH] Fix the bug that sometimes cannot auto login with enableAutoSignin = true --- web/src/auth/LoginPage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index 341dc69e..ba22523c 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -99,8 +99,10 @@ class LoginPage extends React.Component { this.setState({enableCaptchaModal: CaptchaRule.Never}); } } + } - if (this.props.account && this.props.account.owner === this.props.application?.organization) { + if (prevProps.account !== this.props.account && this.props.account !== undefined) { + if (this.props.account.owner === this.props.application?.organization) { const params = new URLSearchParams(this.props.location.search); const silentSignin = params.get("silentSignin"); if (silentSignin !== null) {