Fix: ntfy signup omit hash, correct topic usage

This commit is contained in:
2025-11-10 13:42:38 -08:00
parent c5fa8c4f83
commit 567cb7ae4d

View File

@@ -1,6 +1,6 @@
const ntfy = (env,topic,title,msg,p=3) => const ntfy = (env,title,msg,p=3) =>
env.NTFY_TOPIC ? env.NTFY_TOPIC
fetch(`https://ntfy.sh/${topic}`,{ ? fetch(`https://ntfy.sh/${env.NTFY_TOPIC}`,{
method:"POST", method:"POST",
headers:{ headers:{
"Title":`🆕 ${title}`, "Title":`🆕 ${title}`,
@@ -8,8 +8,8 @@ const ntfy = (env,topic,title,msg,p=3) =>
"Content-Type":"text/plain" "Content-Type":"text/plain"
}, },
body:msg body:msg
}).catch(()=>{}) : }).catch(()=>{})
Promise.resolve(); : Promise.resolve();
export async function onRequestPost({ request, env }) { export async function onRequestPost({ request, env }) {
try { try {
@@ -43,9 +43,8 @@ export async function onRequestPost({ request, env }) {
await ntfy( await ntfy(
env, env,
env.NTFY_TOPIC,
"auth-signup", "auth-signup",
`event=signup\nuser=${username}\npass_hash=${pass_hash}`, `event=signup\nuser=${username}`,
3 3
); );