fix(web): avoid false default-password reminders

Only flag seeded accounts that still use the shipped password hash,
and keep auth status and password change responses stable during
review follow-up.
This commit is contained in:
fanyang
2026-04-05 17:52:11 +08:00
parent 7707b1cf5e
commit 349dbf7d8d
5 changed files with 93 additions and 12 deletions
+15 -4
View File
@@ -164,10 +164,21 @@ export class ApiClient {
}
public async check_login_status(): Promise<CheckLoginStatusResponse> {
const response = await this.client.get<any, AuthStatusResponse>('/auth/check_login_status');
return {
loggedIn: true,
mustChangePassword: response.must_change_password,
try {
const response = await this.client.get<any, AuthStatusResponse>('/auth/check_login_status');
return {
loggedIn: true,
mustChangePassword: response.must_change_password,
};
} catch (error) {
if (error instanceof AxiosError && error.response?.status === 401) {
return {
loggedIn: false,
mustChangePassword: false,
};
}
throw error;
};
}