Skip to content

Commit d2c12ea

Browse files
committed
fix: Use other baseURL
1 parent 85efbfc commit d2c12ea

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib/auth-client.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import type { auth } from '$lib/auth'
22
import { PUBLIC_BETTER_AUTH_URL } from '$env/static/public'
33
import { customSessionClient, genericOAuthClient } from 'better-auth/client/plugins'
44
import { createAuthClient } from 'better-auth/svelte'
5-
import { browser } from '$app/environment'
65

7-
// Use current origin in browser (supports preview deployments), fallback to PUBLIC_BETTER_AUTH_URL for SSR
8-
const baseURL = browser ? window.location.origin : PUBLIC_BETTER_AUTH_URL
6+
const baseURL = __DEPLOY_PRIME_URL__ || PUBLIC_BETTER_AUTH_URL
97

108
export const authClient = createAuthClient({
119
baseURL,

0 commit comments

Comments
 (0)