From a92430e8fdcdc35d647a84d2d802f9d85e84f433 Mon Sep 17 00:00:00 2001 From: Attack825 <68852184+Attack825@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:19:45 +0800 Subject: [PATCH] feat: fix auto sign-in flow on result page (#3983) --- controllers/account.go | 3 +-- web/src/auth/ResultPage.js | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/controllers/account.go b/controllers/account.go index 22fee923..e8405dfa 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -286,8 +286,7 @@ func (c *ApiController) Signup() { } } - if application.HasPromptPage() && user.Type == "normal-user" { - // The prompt page needs the user to be signed in + if user.Type == "normal-user" { c.SetSessionUsername(user.GetId()) } diff --git a/web/src/auth/ResultPage.js b/web/src/auth/ResultPage.js index 16ce39a6..55a5f89b 100644 --- a/web/src/auth/ResultPage.js +++ b/web/src/auth/ResultPage.js @@ -18,6 +18,7 @@ import i18next from "i18next"; import {authConfig} from "./Auth"; import * as ApplicationBackend from "../backend/ApplicationBackend"; import * as Setting from "../Setting"; +import * as AuthBackend from "./AuthBackend"; class ResultPage extends React.Component { constructor(props) { @@ -60,6 +61,22 @@ class ResultPage extends React.Component { this.props.onUpdateApplication(application); } + handleSignIn = () => { + AuthBackend.getAccount() + .then((res) => { + if (res.status === "ok" && res.data) { + const linkInStorage = sessionStorage.getItem("signinUrl"); + if (linkInStorage !== null && linkInStorage !== "") { + window.location.href = linkInStorage; + } else { + Setting.goToLink("/"); + } + } else { + Setting.redirectToLoginPage(this.state.application, this.props.history); + } + }); + }; + render() { const application = this.state.application; @@ -89,14 +106,7 @@ class ResultPage extends React.Component { title={i18next.t("signup:Your account has been created!")} subTitle={i18next.t("signup:Please click the below button to sign in")} extra={[ - , ]}