fix: passport outdate caused webapp reload (#27175)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Joel
2025-10-21 11:47:28 +08:00
committed by GitHub
parent e45d5700ec
commit d6e7543ba6
3 changed files with 6 additions and 15 deletions

View File

@@ -30,14 +30,8 @@ type isWebAppLogin = {
app_logged_in: boolean
}
export async function webAppLoginStatus(enabled: boolean, shareCode: string) {
if (!enabled) {
return {
userLoggedIn: true,
appLoggedIn: true,
}
}
export async function webAppLoginStatus(shareCode: string) {
// always need to check login to prevent passport from being outdated
// check remotely, the access token could be in cookie (enterprise SSO redirected with https)
const { logged_in, app_logged_in } = await getPublic<isWebAppLogin>(`/login/status?app_code=${shareCode}`)
return {