chore codes
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import { getClientGeolocation, getIpInfo } from "@/lib/geo";
|
||||
import { getIpInfo } from "@/lib/geo";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
try {
|
||||
const data = await getIpInfo(req);
|
||||
|
||||
const geo = await getClientGeolocation(data.ip);
|
||||
|
||||
console.log("[ClientGeolocation]", geo);
|
||||
|
||||
return Response.json({
|
||||
ip: data.ip,
|
||||
city: data.city,
|
||||
|
||||
+1
-9
@@ -4,12 +4,7 @@ import { auth } from "auth";
|
||||
import { NextAuthRequest } from "next-auth/lib";
|
||||
|
||||
import { siteConfig } from "./config/site";
|
||||
import {
|
||||
extractRealIP,
|
||||
getClientGeolocation,
|
||||
getGeolocation,
|
||||
getUserAgent,
|
||||
} from "./lib/geo";
|
||||
import { extractRealIP, getGeolocation, getUserAgent } from "./lib/geo";
|
||||
|
||||
export const config = {
|
||||
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
|
||||
@@ -39,9 +34,6 @@ async function handleShortUrl(req: NextAuthRequest) {
|
||||
|
||||
const geo = await getGeolocation(req, ip || "::1");
|
||||
|
||||
const test_geo = await getClientGeolocation(ip);
|
||||
console.log("[ClientGeolocation]", test_geo);
|
||||
|
||||
const url = new URL(req.url);
|
||||
const password = url.searchParams.get("password") || "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user