forked from boos/BoosAPI
fix(proxy): apply account proxy to balance refresh and income fallback calls
This commit is contained in:
@@ -429,12 +429,12 @@ export async function refreshBalance(accountId: number) {
|
|||||||
|
|
||||||
if (canTryManagedSub2ApiRefresh) {
|
if (canTryManagedSub2ApiRefresh) {
|
||||||
try {
|
try {
|
||||||
const refreshed = await refreshSub2ApiManagedSession({
|
const refreshed = await withAccountProxyOverride(accountProxyUrl, () => refreshSub2ApiManagedSession({
|
||||||
account,
|
account,
|
||||||
site,
|
site,
|
||||||
currentAccessToken: activeAccessToken,
|
currentAccessToken: activeAccessToken,
|
||||||
currentExtraConfig: activeExtraConfig,
|
currentExtraConfig: activeExtraConfig,
|
||||||
});
|
}));
|
||||||
activeAccessToken = refreshed.accessToken;
|
activeAccessToken = refreshed.accessToken;
|
||||||
activeExtraConfig = refreshed.extraConfig;
|
activeExtraConfig = refreshed.extraConfig;
|
||||||
balanceInfo = await readBalance(activeAccessToken);
|
balanceInfo = await readBalance(activeAccessToken);
|
||||||
@@ -467,12 +467,12 @@ export async function refreshBalance(accountId: number) {
|
|||||||
supportsTodayIncomeLogFallback(site.platform)
|
supportsTodayIncomeLogFallback(site.platform)
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const fallbackIncome = await fetchTodayIncomeFromLogs({
|
const fallbackIncome = await withAccountProxyOverride(accountProxyUrl, () => fetchTodayIncomeFromLogs({
|
||||||
baseUrl: site.url,
|
baseUrl: site.url,
|
||||||
accessToken: activeAccessToken,
|
accessToken: activeAccessToken,
|
||||||
platform: site.platform,
|
platform: site.platform,
|
||||||
platformUserId,
|
platformUserId,
|
||||||
});
|
}));
|
||||||
if (typeof fallbackIncome === 'number' && Number.isFinite(fallbackIncome)) {
|
if (typeof fallbackIncome === 'number' && Number.isFinite(fallbackIncome)) {
|
||||||
balanceInfo.todayIncome = fallbackIncome;
|
balanceInfo.todayIncome = fallbackIncome;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user