BA
Better Auth•2d ago
Lucas

ip address can't set database

import { db } from "@/db";
import * as schema from "@/db/schema";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { nextCookies } from "better-auth/next-js";
import {
admin as adminPlugin,
openAPI,
organization,
twoFactor,
username,
} from "better-auth/plugins";

export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: {
...schema,
},
}),
emailAndPassword: {
enabled: true,
},
plugins: [
adminPlugin({}),
username(),
twoFactor(),
organization(),
openAPI(),
nextCookies(),
],
});
import { db } from "@/db";
import * as schema from "@/db/schema";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { nextCookies } from "better-auth/next-js";
import {
admin as adminPlugin,
openAPI,
organization,
twoFactor,
username,
} from "better-auth/plugins";

export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: {
...schema,
},
}),
emailAndPassword: {
enabled: true,
},
plugins: [
adminPlugin({}),
username(),
twoFactor(),
organization(),
openAPI(),
nextCookies(),
],
});
No description
2 Replies
Rodrigo Santos
Rodrigo Santos•2d ago
At least from my experience you won't get IP's all the time. I am not sure why. If you found a solution tag me 🙂
Ping
Ping•2d ago
Yeah by default IP isn't in headers, it's usually proxies or some layer which appends IPs to headers.

Did you find this page helpful?