feat: replace IP with tailscale url

This commit is contained in:
Max Koon
2025-10-23 16:19:00 -04:00
parent 92a2057179
commit b428ce172d
12 changed files with 186 additions and 90 deletions

View File

@@ -4,6 +4,7 @@ import { genericOAuth } from "better-auth/plugins";
import { expo } from "@better-auth/expo";
import { drizzleSchema } from "@money/shared/db";
import { db } from "./db";
import { BASE_URL, HOST } from "@money/shared";
export const auth = betterAuth({
database: drizzleAdapter(db, {
@@ -11,10 +12,16 @@ export const auth = betterAuth({
provider: "pg",
usePlural: true,
}),
trustedOrigins: ["money://", "http://localhost:8081", "https://money.koon.us"],
trustedOrigins: [
"http://localhost:8081",
`exp://${HOST}:8081`,
`${BASE_URL}:8081`,
"https://money.koon.us",
"money://",
],
advanced: {
crossSubDomainCookies: {
enabled: true,
enabled: process.env.NODE_ENV == 'production',
domain: "koon.us",
},
},

View File

@@ -1,5 +1,6 @@
import { serve } from "@hono/node-server";
import { authDataSchema } from "@money/shared/auth";
import { BASE_URL } from "@money/shared";
import { cors } from "hono/cors";
import { auth } from "./auth";
import { getHono } from "./hono";
@@ -10,7 +11,7 @@ const app = getHono();
app.use(
"/api/*",
cors({
origin: ['https://money.koon.us','http://localhost:8081'],
origin: ['https://money.koon.us', `${BASE_URL}:8081`],
allowMethods: ["POST", "GET", "OPTIONS"],
allowHeaders: ["Content-Type", "Authorization"],
credentials: true,