diff --git a/beszel/site/src/components/login/auth-form.tsx b/beszel/site/src/components/login/auth-form.tsx index 172ac0b..ee02a0a 100644 --- a/beszel/site/src/components/login/auth-form.tsx +++ b/beszel/site/src/components/login/auth-form.tsx @@ -135,7 +135,6 @@ export function UserAuthForm({ toast({ title: t`Error`, description: t`Please enable pop-ups for this site`, - variant: "destructive", }) return } @@ -156,8 +155,11 @@ export function UserAuthForm({ useEffect(() => { // auto login if password disabled and only one auth provider - if (!passwordEnabled && authProviders.length === 1) { - loginWithOauth(authProviders[0], true) + if (!passwordEnabled && authProviders.length === 1 && !sessionStorage.getItem("lo")) { + // Add a small timeout to ensure browser is ready to handle popups + setTimeout(() => { + loginWithOauth(authProviders[0], true) + }, 300) } }, []) diff --git a/beszel/site/src/lib/utils.ts b/beszel/site/src/lib/utils.ts index 4472c51..897dcd4 100644 --- a/beszel/site/src/lib/utils.ts +++ b/beszel/site/src/lib/utils.ts @@ -77,6 +77,7 @@ export const updateSystemList = (() => { /** Logs the user out by clearing the auth store and unsubscribing from realtime updates. */ export async function logOut() { + sessionStorage.setItem("lo", "t") pb.authStore.clear() pb.realtime.unsubscribe() }