Fix sign in github

This commit is contained in:
2026-02-26 15:07:15 +08:00
parent e83bea2bc2
commit 5d9be8c479

View File

@@ -21,7 +21,11 @@ export const getEnv = (key: string, defaultValue = ""): string => {
};
export const VITE_PUBLIC_URL = (() => {
const envUrl = getEnv("VITE_PUBLIC_URL");
// Priority:
// 1. BETTER_AUTH_URL (standard for better-auth)
// 2. VITE_PUBLIC_URL (our app standard)
// 3. window.location.origin (browser fallback)
const envUrl = getEnv("BETTER_AUTH_URL") || getEnv("VITE_PUBLIC_URL");
if (envUrl) return envUrl;
// Fallback for browser