diff --git a/rc_auth/src/main.rs b/rc_auth/src/main.rs index 518769f..bf176fd 100644 --- a/rc_auth/src/main.rs +++ b/rc_auth/src/main.rs @@ -57,7 +57,7 @@ async fn main() -> std::io::Result<()> { App::new() .wrap_fn(|req, srv| { use actix_web::dev::Service; - log::debug!("Request {} {}", req.method(), req.path()); + log::trace!("Request {} {}", req.method(), req.path()); srv.call(req) }) .app_data(cli_args2.clone()) @@ -74,7 +74,7 @@ async fn main() -> std::io::Result<()> { .service(robocraft::email::email_password_auth) .service(robocraft::steam::steam_auth) .service(robocraft::username::user_password_auth) - .service(robocraft::displayname::displaye_password_auth) + .service(robocraft::displayname::display_password_auth) .service(robocraft::intercom::services_ws) .service(robocraft::intercom::service_msg) .service(robocraft::intercom::lobby_state_ws) diff --git a/rc_auth/src/robocraft/displayname.rs b/rc_auth/src/robocraft/displayname.rs index e7746a8..1e60c63 100644 --- a/rc_auth/src/robocraft/displayname.rs +++ b/rc_auth/src/robocraft/displayname.rs @@ -2,7 +2,7 @@ use oj_rc_core::persist::user::FederatedAuthenticator; use actix_web::{post, web::{Data, Json}}; #[post("/authenticate/displayname/game")] -pub async fn displaye_password_auth(body: Json, config: Data) -> Result, super::ErrorTy> { +pub async fn display_password_auth(body: Json, config: Data) -> Result, super::ErrorTy> { if body.display_name.is_none() { return Err(super::ErrorTy::from_err(oj_rc_core::persist::user::AuthError { message: "Missing display_name".to_owned(), diff --git a/rc_auth/src/robocraft/intercom/services.rs b/rc_auth/src/robocraft/intercom/services.rs index 5debfbf..9c9d126 100644 --- a/rc_auth/src/robocraft/intercom/services.rs +++ b/rc_auth/src/robocraft/intercom/services.rs @@ -4,7 +4,6 @@ use actix_web::{rt, web::{Payload, Data, Path, Json}, Error, HttpRequest, HttpRe #[get("/intercom/.oj_services/{name}")] pub async fn services_ws(req: HttpRequest, stream: Payload, auth: Data, reg: Data, name: Path) -> Result { - log::debug!("intercom/.oj_services name is {}", name); auth.validate(&req, &format!(".oj_services/{}", urlencoding::encode(&*name)))?; let (res, mut session, _stream) = actix_ws::handle(&req, stream)?; diff --git a/rc_core/src/persist/federation.rs b/rc_core/src/persist/federation.rs index f4b4d8a..9aeba58 100644 --- a/rc_core/src/persist/federation.rs +++ b/rc_core/src/persist/federation.rs @@ -30,9 +30,9 @@ fn default_aliases() -> std::collections::HashMap { fn default_defederated() -> Vec { vec![ "robocraftgame.com".to_owned(), - #[cfg(debug_assertions)] + #[cfg(not(debug_assertions))] { "127.0.0.1:8002".to_owned() }, - #[cfg(debug_assertions)] + #[cfg(not(debug_assertions))] { "127.0.0.1".to_owned() }, ] } diff --git a/rc_core/src/persist/user/account_json.rs b/rc_core/src/persist/user/account_json.rs index 051cae1..6629bd0 100644 --- a/rc_core/src/persist/user/account_json.rs +++ b/rc_core/src/persist/user/account_json.rs @@ -263,7 +263,7 @@ impl AccountProvider { let client_details = libfj::robocraft::TokenPayload { public_id: pub_id.clone(), display_name: if is_fedi { format!("{}#{}", user_info.display_name, self.domain) } else { user_info.display_name.clone() }, - robocraft_name: if is_fedi { format!("{}#{}", user_info.public_id, self.domain) } else { user_info.public_id.clone() }, + robocraft_name: pub_id.clone(), email_address: user_info.email, email_verified: true, flags: vec![ diff --git a/rc_core/src/persist/user/federation.rs b/rc_core/src/persist/user/federation.rs index d1dae72..1f33f12 100644 --- a/rc_core/src/persist/user/federation.rs +++ b/rc_core/src/persist/user/federation.rs @@ -131,7 +131,7 @@ impl super::AccountProvider { || target_domain == "0:0:0:0:0:0:0:1" || target_domain.starts_with("127.0.0.") || target_domain.starts_with("localhost:"); - // TODO contact other domain + // contact other domain to get oauth (auth) and root server let social_urls_api = if is_localhost { format!("http://{}/{}", target_domain, SOCIETY_URLS_API_ENDPOINT) } else { @@ -236,7 +236,6 @@ impl super::AccountProvider { code: crate::data::error_codes::AuthErrorCode::BadCredentials, }); }; - //let auth_redirected_url = auth_resp.url(); log::debug!("OAuth auth response URL: {}", auth_redirected_url); let mut query_map: std::collections::HashMap<_, _> = auth_redirected_url.query_pairs().collect(); let auth_code = if let Some(auth_code) = query_map.remove("code") { diff --git a/rc_database/src/wrapper.rs b/rc_database/src/wrapper.rs index afcc8b1..ebd4387 100644 --- a/rc_database/src/wrapper.rs +++ b/rc_database/src/wrapper.rs @@ -938,7 +938,7 @@ impl Database { pub async fn federation_by_domain(&self, domain: &str) -> Result, sea_orm::DbErr> { crate::schema::federation::Entity::find() - .filter(crate::schema::federation::Column::Id.eq(domain)) + .filter(crate::schema::federation::Column::Domain.eq(domain)) .one(self.orm.as_ref()) .await }