bagsy/apps/api/lib/auth.ts
bananabas 88701de549 chore: clean up project structure
- Remove duplicate iOS app folder (ShopList/ → consolidated to Bagsy/)
- Remove build artifacts from git tracking
- Remove stale documentation files
- Remove old React Native mobile code
- Add PROJECT_STATUS.md for clear project overview

iOS app is now clearly organized under apps/ios/Bagsy/ with single Xcode project (Bagsy.xcodeproj)
2026-04-13 17:16:11 +01:00

32 lines
759 B
TypeScript

import { betterAuth } from 'better-auth';
import { organization, passkey, magicLink } from 'better-auth/plugins';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { db } from '@/db';
const baseURL = process.env.BETTER_AUTH_URL || 'http://localhost:3001';
export const auth = betterAuth({
baseURL,
database: drizzleAdapter(db, {
provider: 'pg',
}),
emailAndPassword: {
enabled: true,
},
plugins: [
organization(),
passkey(),
magicLink({
sendMagicLink: async ({ email, url }) => {
console.log(`Magic link for ${email}: ${url}`);
},
}),
],
trustedOrigins: [
baseURL,
'bagsy://',
'bagsy://localhost',
'http://localhost:3001',
'http://192.168.*:3001',
],
});