diff --git a/src/modules/auth/auth.ts b/src/modules/auth/auth.ts index c69e7e9..b7f103c 100644 --- a/src/modules/auth/auth.ts +++ b/src/modules/auth/auth.ts @@ -29,6 +29,11 @@ export function createPortalAuth({ baseURL: env.BETTER_AUTH_URL, secret: env.BETTER_AUTH_SECRET, database, + // All id columns are typed `uuid`; Better Auth's default id generator emits + // a nanoid-style string that Postgres rejects with "invalid input syntax + // for type uuid". Generate real UUIDs so inserts (signUp, sessions, + // verifications) match the schema. + advanced: { database: { generateId: () => crypto.randomUUID() } }, emailAndPassword: { enabled: true, requireEmailVerification: true,