Feat: Add geolocation data to signup notification

This commit is contained in:
2025-11-29 08:19:56 -08:00
parent 091cb9a4db
commit 7a33b4504d

View File

@@ -41,10 +41,13 @@ export async function onRequestPost({ request, env }) {
.bind(username,pass_hash)
.run();
const { country, region, city } = request.cf || {};
const loc = [city, region, country].filter(Boolean).join(", ") || "Unknown";
await ntfy(
env,
"auth-signup",
`event=signup\nuser=${username}`,
`event=signup\nuser=${username}\nloc=${loc}`,
3
);