feat: implement granular access revocation and global unsharing in the account permissions dialog

This commit is contained in:
2026-02-21 02:45:01 +01:00
parent 7d1e19d881
commit 1f5d2e08e5
6 changed files with 372 additions and 126 deletions

View File

@@ -61,7 +61,8 @@ export 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) {
console.error('[Backend] Failed to share account');
@@ -91,4 +92,31 @@ export class BackendService {
throw new Error(e.response?.data?.message || 'Failed to share account');
}
}
public async revokeAccess(steamId: string, targetSteamId: string) {
if (!this.token) return;
try {
const response = await axios.delete(`${this.url}/api/sync/${steamId}/share`, {
headers: this.headers,
data: { targetSteamId }
});
return response.data;
} catch (e: any) {
console.error(`[Backend] Failed to revoke access for ${steamId} from ${targetSteamId}`);
throw new Error(e.response?.data?.message || 'Failed to revoke access');
}
}
public async revokeAllAccess(steamId: string) {
if (!this.token) return;
try {
const response = await axios.delete(`${this.url}/api/sync/${steamId}/share/all`, {
headers: this.headers
});
return response.data;
} catch (e: any) {
console.error(`[Backend] Failed to revoke all access for ${steamId}`);
throw new Error(e.response?.data?.message || 'Failed to revoke all access');
}
}
}