about summary refs log tree commit diff
path: root/kittybox-rs/src/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs/src/frontend')
-rw-r--r--kittybox-rs/src/frontend/onboarding.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/kittybox-rs/src/frontend/onboarding.rs b/kittybox-rs/src/frontend/onboarding.rs
index b498aed..b460e6a 100644
--- a/kittybox-rs/src/frontend/onboarding.rs
+++ b/kittybox-rs/src/frontend/onboarding.rs
@@ -54,8 +54,12 @@ 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
-    let user =
-        crate::tokenauth::User::new(user_uid.as_str(), "https://kittybox.fireburn.ru/", "create");
+    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
+    };
 
     if data.user["type"][0] != "h-card" || data.first_post["type"][0] != "h-entry" {
         return Err(FrontendError::with_code(
@@ -96,7 +100,7 @@ async fn onboard<D: Storage + 'static>(
             .map_err(FrontendError::from)?;
     }
     let (uid, post) = crate::micropub::normalize_mf2(data.first_post, &user);
-    crate::micropub::_post(user, uid, post, db, http)
+    crate::micropub::_post(&user, uid, post, db, http)
         .await
         .map_err(|e| FrontendError {
             msg: "Error while posting the first post".to_string(),