No more manual LAN_HOST or BETTER_AUTH_TRUSTED_ORIGINS for dev. Uses os.networkInterfaces() to allow all machine IPs automatically.
17 lines
554 B
TypeScript
17 lines
554 B
TypeScript
import type { NextConfig } from "next";
|
|
import os from "os";
|
|
|
|
// Автоопределение LAN IP для dev — убирает "Blocked cross-origin" без ручной настройки
|
|
const lanIPs = Object.values(os.networkInterfaces())
|
|
.flat()
|
|
.filter((iface) => iface && !iface.internal && iface.family === "IPv4")
|
|
.map((iface) => iface!.address);
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
serverExternalPackages: ["@prisma/client", "bcryptjs", "ioredis"],
|
|
allowedDevOrigins: lanIPs,
|
|
};
|
|
|
|
export default nextConfig;
|