mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-01 20:06:41 -05:00
fix: return local IP in development mode (#2511)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user