Initial commit create-t3-app

This commit is contained in:
2026-07-10 14:31:04 -04:00
commit ed948f5264
31 changed files with 2211 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient();
export type Session = typeof authClient.$Infer.Session;
+23
View File
@@ -0,0 +1,23 @@
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { env } from "~/env";
import { db } from "~/server/db";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "sqlite", // or "pg" or "mysql"
}),
emailAndPassword: {
enabled: true,
},
socialProviders: {
github: {
clientId: env.BETTER_AUTH_GITHUB_CLIENT_ID,
clientSecret: env.BETTER_AUTH_GITHUB_CLIENT_SECRET,
redirectURI: "http://localhost:3000/api/auth/callback/github",
},
},
});
export type Session = typeof auth.$Infer.Session;
+1
View File
@@ -0,0 +1 @@
export { auth } from "./config";
+7
View File
@@ -0,0 +1,7 @@
import { auth } from ".";
import { headers } from "next/headers";
import { cache } from "react";
export const getSession = cache(async () =>
auth.api.getSession({ headers: await headers() }),
);