feat(data): SyncProvider::delete_account + SolitaireServerClient impl
Adds delete_account() as a default no-op on the SyncProvider trait. SolitaireServerClient sends DELETE /api/account with JWT (retry on 401). The server handler already existed (DELETE /api/account, ON DELETE CASCADE). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,11 @@ pub trait SyncProvider: Send + Sync {
|
||||
async fn opt_out_leaderboard(&self) -> Result<(), SyncError> {
|
||||
Ok(())
|
||||
}
|
||||
/// Permanently delete the authenticated player's account and all server
|
||||
/// data. No-op for backends that don't support account management.
|
||||
async fn delete_account(&self) -> Result<(), SyncError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Blanket impl so `Box<dyn SyncProvider + Send + Sync>` (returned by
|
||||
@@ -84,6 +89,9 @@ impl SyncProvider for Box<dyn SyncProvider + Send + Sync> {
|
||||
async fn opt_out_leaderboard(&self) -> Result<(), SyncError> {
|
||||
(**self).opt_out_leaderboard().await
|
||||
}
|
||||
async fn delete_account(&self) -> Result<(), SyncError> {
|
||||
(**self).delete_account().await
|
||||
}
|
||||
}
|
||||
|
||||
pub mod stats;
|
||||
|
||||
Reference in New Issue
Block a user