From 55095dcd006f53c186b3fbbfd6aa90c222df87c7 Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Wed, 5 Aug 2026 17:07:22 +0200 Subject: [PATCH] chore: highlight totp app friendly name (#48755) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? UI update ## What is the current behavior? We only show the alternative factor's name, if one exists. ## What is the new behavior? When presenting user with the MFA screen, make the MFA factor's friendly_name appear. ## Additional context Before: Screenshot 2026-08-05 at 15 41 07 After: Screenshot 2026-08-05 at 15 38 27 Screenshot 2026-08-05 at 15 37 43 ## Summary by CodeRabbit * **Bug Fixes** * Improved multi-factor authentication prompts with clearer formatting and more consistent factor labels. * Ensured the primary code label appears whenever a verification factor is selected. * Added a fallback label for authentication factors without a display name. --- .../interfaces/SignIn/SignInMfaForm.tsx | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx index 3e9d040ae21..92bc0850ef8 100644 --- a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx +++ b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx @@ -26,6 +26,11 @@ const schema = z.object({ const formId = 'sign-in-mfa-form' +function getFactorDisplayName(factor: Pick | null | undefined): string { + const name = factor?.friendly_name?.trim() + return name && name.length > 0 ? name : 'your authenticator app' +} + interface SignInMfaFormProps { context?: 'forgot-password' | 'sign-in' } @@ -142,9 +147,14 @@ export const SignInMfaForm = ({ context = 'sign-in' }: SignInMfaFormProps) => { + Code generated by{' '} + + {getFactorDisplayName(selectedFactor)} + + + ) : null } > @@ -208,9 +218,13 @@ export const SignInMfaForm = ({ context = 'sign-in' }: SignInMfaFormProps) => { onClick={() => setSelectedFactor(factors.totp.find((f) => f.id !== selectedFactor?.id)!) } - >{`Authenticate using ${ - factors.totp.find((f) => f.id !== selectedFactor?.id)?.friendly_name - }?`} + > + Authenticate using{' '} + + {getFactorDisplayName(factors.totp.find((f) => f.id !== selectedFactor?.id))} + + ? + )}