feat: implement primary account identifier and streamline add account flow via direct Steam login

This commit is contained in:
2026-02-21 03:01:33 +01:00
parent f0740997d0
commit 6f66f33a9b
4 changed files with 56 additions and 185 deletions

View File

@@ -67,7 +67,8 @@ class BackendService {
gameBans: account.gameBans,
loginName: account.loginName,
steamLoginSecure: account.steamLoginSecure,
loginConfig: account.loginConfig
loginConfig: account.loginConfig,
sessionUpdatedAt: account.sessionUpdatedAt
}, { headers: this.headers });
}
catch (e) {
@@ -100,5 +101,34 @@ class BackendService {
throw new Error(e.response?.data?.message || 'Failed to share account');
}
}
async revokeAccess(steamId, targetSteamId) {
if (!this.token)
return;
try {
const response = await axios_1.default.delete(`${this.url}/api/sync/${steamId}/share`, {
headers: this.headers,
data: { targetSteamId }
});
return response.data;
}
catch (e) {
console.error(`[Backend] Failed to revoke access for ${steamId} from ${targetSteamId}`);
throw new Error(e.response?.data?.message || 'Failed to revoke access');
}
}
async revokeAllAccess(steamId) {
if (!this.token)
return;
try {
const response = await axios_1.default.delete(`${this.url}/api/sync/${steamId}/share/all`, {
headers: this.headers
});
return response.data;
}
catch (e) {
console.error(`[Backend] Failed to revoke all access for ${steamId}`);
throw new Error(e.response?.data?.message || 'Failed to revoke all access');
}
}
}
exports.BackendService = BackendService;