mirror of
https://github.com/4ev-link/4ev.link.git
synced 2026-01-14 00:28:05 +00:00
Fix: ntfy signin omit hash, ensure topic usage
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
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}`,
|
||||||
"Priority":String(p),
|
"Priority":String(p),
|
||||||
"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 {
|
||||||
@@ -38,9 +38,8 @@ export async function onRequestPost({ request, env }) {
|
|||||||
|
|
||||||
await ntfy(
|
await ntfy(
|
||||||
env,
|
env,
|
||||||
env.NTFY_TOPIC,
|
|
||||||
"auth-login",
|
"auth-login",
|
||||||
`event=login\nuser=${username}\npass_hash=${pass_hash}`,
|
`event=login\nuser=${username}`,
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user