delete method
Deletes the current user's account.
This action is irreversible. Use with caution.
Returns an AuthResponse indicating success or failure.
Example:
final response = await authClient.account.delete();
if (response.isSuccess) {
print('Account deleted');
}
Implementation
Future<AuthResponse<void>> delete() async {
try {
await _dio.post(ApiEndpoints.deleteAccount);
return AuthResponse.success(null);
} on DioException catch (e) {
return AuthResponse.error(AuthError.fromDio(e));
}
}