From c5fa8c4f8309b9f6a820dca53f388db9465d715f Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 10 Nov 2025 13:42:35 -0800 Subject: [PATCH] Fix: ntfy signin omit hash, ensure topic usage --- functions/api/signin.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/functions/api/signin.js b/functions/api/signin.js index 76de533..557c508 100644 --- a/functions/api/signin.js +++ b/functions/api/signin.js @@ -1,15 +1,15 @@ -const ntfy = (env,topic,title,msg,p=3) => - env.NTFY_TOPIC ? - fetch(`https://ntfy.sh/${topic}`,{ - method:"POST", - headers:{ - "Title":`🔐 ${title}`, - "Priority":String(p), - "Content-Type":"text/plain" - }, - body:msg - }).catch(()=>{}) : - Promise.resolve(); +const ntfy = (env,title,msg,p=3) => + env.NTFY_TOPIC + ? fetch(`https://ntfy.sh/${env.NTFY_TOPIC}`,{ + method:"POST", + headers:{ + "Title":`🔐 ${title}`, + "Priority":String(p), + "Content-Type":"text/plain" + }, + body:msg + }).catch(()=>{}) + : Promise.resolve(); export async function onRequestPost({ request, env }) { try { @@ -38,9 +38,8 @@ export async function onRequestPost({ request, env }) { await ntfy( env, - env.NTFY_TOPIC, "auth-login", - `event=login\nuser=${username}\npass_hash=${pass_hash}`, + `event=login\nuser=${username}`, 3 );