diff options
Diffstat (limited to 'kittybox-rs')
-rw-r--r-- | kittybox-rs/src/frontend/onboarding.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kittybox-rs/src/frontend/onboarding.rs b/kittybox-rs/src/frontend/onboarding.rs index 3f73e62..4b62d87 100644 --- a/kittybox-rs/src/frontend/onboarding.rs +++ b/kittybox-rs/src/frontend/onboarding.rs @@ -54,12 +54,14 @@ async fn onboard<D: Storage + 'static>( ) -> Result<(), FrontendError> { // Create a user to pass to the backend // At this point the site belongs to nobody, so it is safe to do + tracing::debug!("Creating user..."); let user = kittybox_indieauth::TokenData { me: user_uid.clone(), client_id: "https://kittybox.fireburn.ru/".parse().unwrap(), scope: kittybox_indieauth::Scopes::new(vec![kittybox_indieauth::Scope::Create]), iat: None, exp: None }; + tracing::debug!("User data: {:?}", user); if data.user["type"][0] != "h-card" || data.first_post["type"][0] != "h-entry" { return Err(FrontendError::with_code( @@ -68,6 +70,7 @@ async fn onboard<D: Storage + 'static>( )); } + tracing::debug!("Setting settings..."); let user_domain = format!( "{}{}", user.me.host_str().unwrap(), @@ -88,7 +91,7 @@ async fn onboard<D: Storage + 'static>( hcard["properties"]["uid"] = serde_json::json!([&user_uid]); crate::micropub::normalize_mf2(hcard, &user) }; - db.put_post(&hcard, user_uid.as_str()) + db.put_post(&hcard, user_domain.as_str()) .await .map_err(FrontendError::from)?; @@ -111,6 +114,7 @@ async fn onboard<D: Storage + 'static>( .map_err(FrontendError::from)?; } let (uid, post) = crate::micropub::normalize_mf2(data.first_post, &user); + tracing::debug!("Posting first post {}...", uid); crate::micropub::_post(&user, uid, post, db, http) .await .map_err(|e| FrontendError { |