Files
Zero/lib/auth.ts
Argenis Cuellar 15a961a8b9 feat: better-auth implementation with drizzle (#17)
* feat: better-auth implementation

* feat: added signout

* feat: added conditional sign in or signout button

* chore: updated sign in description

* feat: added conditional log in rendering

* Update example.env

Co-authored-by: Praash <99237795+Praashh@users.noreply.github.com>

* chore: remove param

* chore: lint and format

* chore: rename env example file

* fixes

---------

Co-authored-by: Praash <99237795+Praashh@users.noreply.github.com>
Co-authored-by: Nizzy <nizabizaher@gmail.com>
2025-02-06 20:39:45 -05:00

16 lines
396 B
TypeScript

import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { betterAuth } from "better-auth";
import { db } from "@/db";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),
socialProviders: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
},
},
});