chore: set baseURL in better auth

This commit is contained in:
javayhu 2025-05-15 23:58:48 +08:00
parent 50d6e2b069
commit 0585fb3253
2 changed files with 2 additions and 3 deletions

View File

@ -5,8 +5,6 @@
# For development, set to http://localhost:3000 or any other port
# -----------------------------------------------------------------------------
NEXT_PUBLIC_BASE_URL="http://localhost:3000"
# If your development port is not 3000, please set PORT to your port, e.g. 3005
PORT=3000
# -----------------------------------------------------------------------------
# Database

View File

@ -10,7 +10,7 @@ import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { admin } from 'better-auth/plugins';
import { parse as parseCookies } from 'cookie';
import type { Locale } from 'next-intl';
import { getUrlWithLocaleInCallbackUrl } from './urls/urls';
import { getBaseUrl, getUrlWithLocaleInCallbackUrl } from './urls/urls';
/**
* Better Auth configuration
@ -20,6 +20,7 @@ import { getUrlWithLocaleInCallbackUrl } from './urls/urls';
* https://www.better-auth.com/docs/reference/options
*/
export const auth = betterAuth({
baseURL: getBaseUrl(),
appName: defaultMessages.Metadata.name,
database: drizzleAdapter(db, {
provider: 'pg', // or "mysql", "sqlite"