fix: return local IP in development mode (#2511)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Alexander Vencel
2025-09-11 15:05:56 -05:00
committed by GitHub
parent 01365ee033
commit b4ad688cc0

View File

@@ -1,5 +1,5 @@
import type { BetterAuthOptions } from "../types";
import { isTest } from "../utils/env";
import { isDevelopment, isTest } from "../utils/env";
export function getIp(
req: Request | Headers,
@@ -12,6 +12,9 @@ export function getIp(
if (isTest()) {
return "127.0.0.1"; // Use a fixed IP for test environments
}
if (isDevelopment) {
return "127.0.0.1"; // Use a fixed IP for development environments
}
const headers = "headers" in req ? req.headers : req;