import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";
import { admin } from "better-auth/plugins"
import { nextCookies } from "better-auth/next-js";
const client = new MongoClient("mongodb://127.0.0.1:27017/teste");
const db = client.db();
export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true,
minPasswordLength: 5
},
plugins: [
admin(),
nextCookies()
],
});
import { betterAuth } from "better-auth";
import { MongoClient } from "mongodb";
import { mongodbAdapter } from "better-auth/adapters/mongodb";
import { admin } from "better-auth/plugins"
import { nextCookies } from "better-auth/next-js";
const client = new MongoClient("mongodb://127.0.0.1:27017/teste");
const db = client.db();
export const auth = betterAuth({
database: mongodbAdapter(db),
emailAndPassword: {
enabled: true,
minPasswordLength: 5
},
plugins: [
admin(),
nextCookies()
],
});