diff --git a/src/auth.rs b/src/auth.rs index 877a32b..bea9eb5 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -12,9 +12,10 @@ struct AuthApiRes { user_id: String, } -pub fn auth(_server: &Arc, client: &mut Client, token: &str) -> crate::Result { +pub fn auth(server: &Arc, client: &mut Client, token: &str) -> crate::Result { let mut res = ureq::get(format!( - "http://localhost:3000/api/auth?intents=server&token={token}" + "https://vxchat.netlify.app/api/auth?token={token}&key={}", + server.config.server_key )) .call() .context("Failed to authenticate")?; diff --git a/src/lib.rs b/src/lib.rs index befc286..cf964b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,10 +19,11 @@ pub use once_cell; #[derive(serde::Serialize, serde::Deserialize)] pub struct ServerConfig { - server_name: String, - server_id: String, - port: u16, - channels: Vec, + pub server_name: String, + pub server_id: String, + pub server_key: String, + pub port: u16, + pub channels: Vec, } #[allow(dead_code)] @@ -40,6 +41,7 @@ impl Default for ServerConfig { port: 7080, server_name: format!("Server Name"), server_id: format!("offline-server"), + server_key: format!(""), channels: Vec::new(), } }