feat: better client name w/ hostname

This commit is contained in:
DecDuck
2025-04-04 10:14:23 +11:00
parent 137b71b3ba
commit 77251a6524
3 changed files with 47 additions and 13 deletions

View File

@ -2,6 +2,7 @@ use std::{env, sync::Mutex};
use chrono::Utc;
use droplet_rs::ssl::sign_nonce;
use gethostname::gethostname;
use log::{debug, error, warn};
use serde::{Deserialize, Serialize};
use serde_json::json;
@ -162,9 +163,11 @@ pub fn auth_initiate_logic() -> Result<(), RemoteAccessError> {
Url::parse(&db_lock.base_url.clone())?
};
let hostname = gethostname();
let endpoint = base_url.join("/api/v1/client/auth/initiate")?;
let body = InitiateRequestBody {
name: "Drop Desktop Client".to_string(),
name: format!("{} (Desktop)", hostname.into_string().unwrap()),
platform: env::consts::OS.to_string(),
};