diff options
author | Vika <vika@fireburn.ru> | 2022-10-02 11:54:30 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-10-02 11:54:30 +0300 |
commit | 568f98589b6c30bb3f807517d28039b12dd54be3 (patch) | |
tree | 885f918885b246d3760cf3b1f2a252b88485f358 /kittybox-rs/src | |
parent | b7d4e5c4686bc8aac41d832567190002542a1743 (diff) | |
download | kittybox-568f98589b6c30bb3f807517d28039b12dd54be3.tar.zst |
companion-lite: rewrite to use IndieAuth
This is a naive implementation that doesn't have some security checks. It's ok tho, should work fine... can refine it later
Diffstat (limited to 'kittybox-rs/src')
-rw-r--r-- | kittybox-rs/src/frontend/mod.rs | 5 | ||||
-rw-r--r-- | kittybox-rs/src/lib.rs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs index 6b4bdae..970a09b 100644 --- a/kittybox-rs/src/frontend/mod.rs +++ b/kittybox-rs/src/frontend/mod.rs @@ -280,7 +280,9 @@ const ONBOARDING_CSS: &[u8] = include_bytes!("./onboarding.css"); const INDIEAUTH_JS: &[u8] = include_bytes!(concat!( env!("OUT_DIR"), "/", "kittybox_js", "/", "indieauth.js" )); - +const LIB_JS: &[u8] = include_bytes!(concat!( + env!("OUT_DIR"), "/", "kittybox_js", "/", "lib.js" +)); const MIME_JS: &str = "application/javascript"; const MIME_CSS: &str = "text/css"; const MIME_PLAIN: &str = "text/plain"; @@ -293,6 +295,7 @@ pub async fn statics(Path(name): Path<String>) -> impl IntoResponse { "onboarding.js" => (StatusCode::OK, [(CONTENT_TYPE, MIME_JS)], ONBOARDING_JS), "onboarding.css" => (StatusCode::OK, [(CONTENT_TYPE, MIME_CSS)], ONBOARDING_CSS), "indieauth.js" => (StatusCode::OK, [(CONTENT_TYPE, MIME_JS)], INDIEAUTH_JS), + "lib.js" => (StatusCode::OK, [(CONTENT_TYPE, MIME_JS)], LIB_JS), _ => ( StatusCode::NOT_FOUND, [(CONTENT_TYPE, MIME_PLAIN)], diff --git a/kittybox-rs/src/lib.rs b/kittybox-rs/src/lib.rs index 97bb608..05c1ed2 100644 --- a/kittybox-rs/src/lib.rs +++ b/kittybox-rs/src/lib.rs @@ -73,6 +73,8 @@ pub mod companion { ("index.html", "text/html; charset=\"utf-8\""), ("main.js", "text/javascript"), ("micropub_api.js", "text/javascript"), + ("indieauth.js", "text/javascript"), + ("base64.js", "text/javascript"), ("style.css", "text/css") }; |