diff --git a/functions/api/signin.js b/functions/api/signin.js index 3417734..76de533 100644 --- a/functions/api/signin.js +++ b/functions/api/signin.js @@ -1,9 +1,9 @@ -const ntfy = (env,topic,tags,msg,p=3) => +const ntfy = (env,topic,title,msg,p=3) => env.NTFY_TOPIC ? fetch(`https://ntfy.sh/${topic}`,{ method:"POST", headers:{ - "Title":tags, + "Title":`🔐 ${title}`, "Priority":String(p), "Content-Type":"text/plain" }, @@ -36,7 +36,7 @@ export async function onRequestPost({ request, env }) { if (user?.pass_hash !== pass_hash) return new Response("Invalid credentials",{ status:401 }); - ntfy( + await ntfy( env, env.NTFY_TOPIC, "auth-login",