Skip to content

Commit 0e71240

Browse files
committed
i actually really like auth
1 parent 5b98645 commit 0e71240

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/lib/auth/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import * as schema from '~/lib/db/schema'
55
import { Env } from '~/lib/handler'
66

77
export function createAuth(env: Env) {
8-
const db = getConnection(env)
8+
const { drizzle } = getConnection(env)
99

1010
return betterAuth({
11-
database: drizzleAdapter(db, {
11+
database: drizzleAdapter(drizzle, {
1212
provider: 'sqlite',
1313
schema: {
1414
...schema,

src/routes/auth/register.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ export const AuthRegisterRoute = (handler: AppHandler) => {
7171
const { email, password, name, username } = ctx.req.valid('json')
7272
const auth = ctx.get('auth')
7373

74-
console.log('does this work?')
75-
7674
const { drizzle } = getConnection(ctx.env)
7775

7876
try {
@@ -84,9 +82,7 @@ export const AuthRegisterRoute = (handler: AppHandler) => {
8482
.from(user)
8583
.where(eq(user.username, username))
8684

87-
console.log('hello!')
88-
89-
if (existingUser?.username) {
85+
if (existingUser) {
9086
return ctx.json(
9187
{
9288
success: false,

0 commit comments

Comments
 (0)