silence cargo warnings.
we'll add back deleted code when we actually need them.
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
pub mod app_data;
|
||||
pub mod interaction;
|
||||
|
||||
pub use interaction::*;
|
||||
|
||||
@@ -11,8 +11,6 @@ pub enum RemoteError {
|
||||
Http(#[from] reqwest::Error),
|
||||
#[error("JSON parse error: {0}")]
|
||||
Json(#[from] serde_json::Error),
|
||||
#[error("{0}")]
|
||||
Api(String),
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize, Deserialize, Clone, Debug, TS)]
|
||||
|
||||
@@ -21,13 +21,6 @@ pub struct UserProfile {
|
||||
pub active_doll_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize, Deserialize, Clone, Debug, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct UpdateUserDto {
|
||||
// Empty as per API schema
|
||||
}
|
||||
|
||||
pub struct UserRemote {
|
||||
pub base_url: String,
|
||||
pub client: Client,
|
||||
@@ -59,28 +52,6 @@ impl UserRemote {
|
||||
Ok(user)
|
||||
}
|
||||
|
||||
pub async fn update_user(
|
||||
&self,
|
||||
user_id: Option<&str>,
|
||||
update: UpdateUserDto,
|
||||
) -> Result<UserProfile, Error> {
|
||||
let url = format!("{}/users/{}", self.base_url, user_id.unwrap_or("me"));
|
||||
let resp = with_auth(self.client.put(url))
|
||||
.await
|
||||
.json(&update)
|
||||
.send()
|
||||
.await?;
|
||||
let user = resp.json().await?;
|
||||
Ok(user)
|
||||
}
|
||||
|
||||
pub async fn delete_user(&self, user_id: Option<&str>) -> Result<(), Error> {
|
||||
let url = format!("{}/users/{}", self.base_url, user_id.unwrap_or("me"));
|
||||
let resp = with_auth(self.client.delete(url)).await.send().await?;
|
||||
resp.error_for_status()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn set_active_doll(&self, doll_id: &str) -> Result<(), Error> {
|
||||
let url = format!("{}/users/me/active-doll/{}", self.base_url, doll_id);
|
||||
let resp = with_auth(self.client.put(url)).await.send().await?;
|
||||
|
||||
@@ -37,9 +37,6 @@ pub enum OAuthError {
|
||||
#[error("Failed to exchange code: {0}")]
|
||||
ExchangeFailed(String),
|
||||
|
||||
#[error("Invalid callback state - possible CSRF attack")]
|
||||
InvalidState,
|
||||
|
||||
#[error("Missing callback parameter: {0}")]
|
||||
MissingParameter(String),
|
||||
|
||||
@@ -67,9 +64,6 @@ pub enum OAuthError {
|
||||
#[error("Failed to refresh token")]
|
||||
RefreshFailed,
|
||||
|
||||
#[error("OAuth state expired or not initialized")]
|
||||
StateExpired,
|
||||
|
||||
#[error("IO error: {0}")]
|
||||
IoError(#[from] std::io::Error),
|
||||
|
||||
@@ -80,8 +74,6 @@ pub enum OAuthError {
|
||||
/// Parameters received from the OAuth callback.
|
||||
pub struct OAuthCallbackParams {
|
||||
state: String,
|
||||
session_state: String,
|
||||
iss: String,
|
||||
code: String,
|
||||
}
|
||||
|
||||
@@ -423,7 +415,10 @@ pub async fn logout_and_restart() -> Result<(), OAuthError> {
|
||||
|
||||
let app_handle = get_app_handle();
|
||||
app_handle.restart();
|
||||
Ok(())
|
||||
//------------------ any code following this expression is unreachable
|
||||
// Ok(())
|
||||
// ^^^^^^ unreachable expression
|
||||
// leaving this here so the AI agent will stop adding this back
|
||||
}
|
||||
|
||||
/// Helper to add authentication header to a request builder if tokens are available.
|
||||
@@ -869,8 +864,6 @@ async fn listen_for_callback(
|
||||
|
||||
let callback_params = OAuthCallbackParams {
|
||||
state: find_param("state")?,
|
||||
session_state: find_param("session_state")?,
|
||||
iss: find_param("iss")?,
|
||||
code: find_param("code")?,
|
||||
};
|
||||
|
||||
|
||||
@@ -66,11 +66,6 @@ fn on_connected(_payload: Payload, socket: RawClient) {
|
||||
emit_initialize(&socket);
|
||||
}
|
||||
|
||||
fn on_reconnect(_payload: Payload, socket: RawClient) {
|
||||
info!("WebSocket reconnected. Re-sending initialization request.");
|
||||
emit_initialize(&socket);
|
||||
}
|
||||
|
||||
fn on_initialized(payload: Payload, _socket: RawClient) {
|
||||
match payload {
|
||||
Payload::Text(values) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
remotes::{dolls::DollsRemote, friends::FriendRemote, user::UserRemote},
|
||||
services::{
|
||||
auth::{load_auth_pass, AuthPass},
|
||||
client_config_manager::{load_app_config, AppConfig, AuthConfig},
|
||||
client_config_manager::{load_app_config, AppConfig},
|
||||
},
|
||||
};
|
||||
use std::{
|
||||
|
||||
Reference in New Issue
Block a user