From 3ac0b185d1e9a4a6833a02856053a81e7c707396 Mon Sep 17 00:00:00 2001 From: henrygd Date: Fri, 25 Jul 2025 13:55:02 -0400 Subject: [PATCH] fix oidc icon display issue (#990) --- .../site/src/components/login/auth-form.tsx | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/beszel/site/src/components/login/auth-form.tsx b/beszel/site/src/components/login/auth-form.tsx index 4738b5c..9c8545e 100644 --- a/beszel/site/src/components/login/auth-form.tsx +++ b/beszel/site/src/components/login/auth-form.tsx @@ -1,5 +1,5 @@ -import { t } from "@lingui/core/macro"; -import { Trans } from "@lingui/react/macro"; +import { t } from "@lingui/core/macro" +import { Trans } from "@lingui/react/macro" import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" import { Input } from "@/components/ui/input" @@ -43,6 +43,14 @@ const showLoginFaliedToast = () => { }) } +const getAuthProviderIcon = (provider: AuthProviderInfo) => { + let { name } = provider + if (name.startsWith("oidc")) { + name = "oidc" + } + return prependBasePath(`/_/images/oauth2/${name}.svg`) +} + export function UserAuthForm({ className, isFirstRun, @@ -165,8 +173,8 @@ export function UserAuthForm({ }, []) return ( -
- {passwordEnabled && ( +
+ {passwordEnabled && ( <>
setErrors({})}>
@@ -242,20 +250,20 @@ export function UserAuthForm({ {(isFirstRun || oauthEnabled) && ( // only show 'continue with' during onboarding or if we have auth providers - (
-
+
+
-
+
Or continue with
-
) +
)} )} - {oauthEnabled && ( + {oauthEnabled && (
{authMethods.oauth2.providers.map((provider) => (
)} - {!oauthEnabled && isFirstRun && ( + {!oauthEnabled && isFirstRun && ( // only show GitHub button / dialog during onboarding - ( - + + - + OAuth 2 / OIDC support @@ -318,9 +326,9 @@ export function UserAuthForm({

- ) + )} - {passwordEnabled && !isFirstRun && ( + {passwordEnabled && !isFirstRun && ( Forgot password? )} -
- ); +
+ ) }