about summary refs log tree commit diff
path: root/templates
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-01-03 13:40:23 +0300
committerVika <vika@fireburn.ru>2025-01-03 13:49:27 +0300
commitdb845e8cc6e3802ed8dde04f9c2aab078e36417d (patch)
tree02394c0e506fd67dc40d39f982eba80e2cc976a3 /templates
parent9e996d892f3896744d0e8999ed3fc5528c607375 (diff)
downloadkittybox-db845e8cc6e3802ed8dde04f9c2aab078e36417d.tar.zst
Fix the IndieAuth script
Change-Id: I17af1bd69de0f885e28db161d9ca81fa199a8aa5
Diffstat (limited to 'templates')
-rw-r--r--templates/javascript/src/indieauth.ts2
-rw-r--r--templates/src/indieauth.rs7
2 files changed, 3 insertions, 6 deletions
diff --git a/templates/javascript/src/indieauth.ts b/templates/javascript/src/indieauth.ts
index 57f075e..eb9331e 100644
--- a/templates/javascript/src/indieauth.ts
+++ b/templates/javascript/src/indieauth.ts
@@ -148,3 +148,5 @@ export async function submit_handler(e: SubmitEvent) {
   }
 
 }
+
+(document.getElementById("indieauth_page") as HTMLFormElement).addEventListener("submit", submit_handler);
diff --git a/templates/src/indieauth.rs b/templates/src/indieauth.rs
index 5f92196..ce67108 100644
--- a/templates/src/indieauth.rs
+++ b/templates/src/indieauth.rs
@@ -10,12 +10,7 @@ markup::define! {
         app: ClientMetadata,
         user: serde_json::Value
     ) {
-        script[type="module"] {
-            @markup::raw(r#"import { submit_handler } from "/.kittybox/static/indieauth.js";
-
-document.getElementById("indieauth_page").addEventListener("submit", submit_handler);
-"#)
-        }
+        script[type="module", src="/.kittybox/static/indieauth.js"] {}
         main {
             form #indieauth_page[action="/.kittybox/indieauth/auth/confirm", method="POST"] {
                 noscript {