mirror of
https://github.com/4ev-link/4ev.link.git
synced 2026-01-14 00:28:05 +00:00
Feat: Add geolocation data to signup notification
This commit is contained in:
@@ -41,10 +41,13 @@ export async function onRequestPost({ request, env }) {
|
|||||||
.bind(username,pass_hash)
|
.bind(username,pass_hash)
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
|
const { country, region, city } = request.cf || {};
|
||||||
|
const loc = [city, region, country].filter(Boolean).join(", ") || "Unknown";
|
||||||
|
|
||||||
await ntfy(
|
await ntfy(
|
||||||
env,
|
env,
|
||||||
"auth-signup",
|
"auth-signup",
|
||||||
`event=signup\nuser=${username}`,
|
`event=signup\nuser=${username}\nloc=${loc}`,
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user