fix(cliproxy): prevent blank page in remote mode

This commit is contained in:
Tam Nhu Tran
2026-02-24 00:47:40 +07:00
parent a6e1455f38
commit 4eb2be79fc
4 changed files with 72 additions and 8 deletions
@@ -184,13 +184,7 @@ router.get('/accounts', async (_req: Request, res: Response): Promise<void> => {
const target = getProxyTarget();
if (target.isRemote) {
const authStatus = await fetchRemoteAuthStatus(target);
// Transform RemoteAuthStatus[] to account summary format
const accounts = authStatus.flatMap((status) =>
status.accounts.map((acc) => ({
provider: status.provider,
...acc,
}))
);
const accounts = authStatus.flatMap((status) => status.accounts);
res.json({ accounts, source: 'remote' });
return;
}