about summary refs log tree commit diff
path: root/kittybox-rs/src/frontend/onboarding.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-06-22 21:35:22 +0300
committerVika <vika@fireburn.ru>2023-06-22 21:35:22 +0300
commit858c0ddd9cc36af0acc72efb1ff1bdc1d8e28b0a (patch)
tree5b46bcc88e37fa0e23fea4f49c0242ad21662bca /kittybox-rs/src/frontend/onboarding.rs
parentd61e1f6a8e5ad5b7c14b1f9ab3101496f3f9ea00 (diff)
downloadkittybox-858c0ddd9cc36af0acc72efb1ff1bdc1d8e28b0a.tar.zst
database: use domains instead of authorities as owner key
This allows disregarding http/https comparisons and simplifies some
database designs.
Diffstat (limited to 'kittybox-rs/src/frontend/onboarding.rs')
-rw-r--r--kittybox-rs/src/frontend/onboarding.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/kittybox-rs/src/frontend/onboarding.rs b/kittybox-rs/src/frontend/onboarding.rs
index f797abd..3f73e62 100644
--- a/kittybox-rs/src/frontend/onboarding.rs
+++ b/kittybox-rs/src/frontend/onboarding.rs
@@ -68,11 +68,18 @@ async fn onboard<D: Storage + 'static>(
         ));
     }
 
-    db.set_setting::<settings::SiteName>(user.me.as_str(), data.blog_name.to_owned())
+    let user_domain = format!(
+        "{}{}",
+        user.me.host_str().unwrap(),
+        user.me.port()
+            .map(|port| format!(":{}", port))
+            .unwrap_or_default()
+    );
+    db.set_setting::<settings::SiteName>(&user_domain, data.blog_name.to_owned())
         .await
         .map_err(FrontendError::from)?;
 
-    db.set_setting::<settings::Webring>(user.me.as_str(), false)
+    db.set_setting::<settings::Webring>(&user_domain, false)
         .await
         .map_err(FrontendError::from)?;