From bbdc08d1da636d763df56d96fd937b5c16744219 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Tue, 28 Oct 2025 08:42:46 -0400 Subject: [PATCH 1/2] fix(clerk-js): Add length check to rendering lastAuthenticationStrategy --- packages/clerk-js/src/ui/elements/SocialButtons.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/clerk-js/src/ui/elements/SocialButtons.tsx b/packages/clerk-js/src/ui/elements/SocialButtons.tsx index d565b0b0c58..bac435748ef 100644 --- a/packages/clerk-js/src/ui/elements/SocialButtons.tsx +++ b/packages/clerk-js/src/ui/elements/SocialButtons.tsx @@ -80,10 +80,11 @@ export const SocialButtons = React.memo((props: SocialButtonsRootProps) => { } const lastAuthenticationStrategy = clerk.client?.lastAuthenticationStrategy as TStrategy | null; + const shouldShowLastAuthenticationStrategy = strategies.length > 1; const { strategyRows, lastAuthenticationStrategyPresent } = distributeStrategiesIntoRows( [...strategies], MAX_STRATEGIES_PER_ROW, - lastAuthenticationStrategy, + shouldShowLastAuthenticationStrategy ? lastAuthenticationStrategy : null, ); const strategyRowOneLength = strategyRows.at(lastAuthenticationStrategyPresent ? 1 : 0)?.length ?? 0; @@ -194,7 +195,9 @@ export const SocialButtons = React.memo((props: SocialButtonsRootProps) => { label={label} textLocalizationKey={localizedText} icon={imageOrInitial} - lastAuthenticationStrategy={strategy === lastAuthenticationStrategy} + lastAuthenticationStrategy={ + shouldShowLastAuthenticationStrategy && strategy === lastAuthenticationStrategy + } /> ); })} From d1c7939f8c731049c7fe38590136cf46a4dfda1d Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Tue, 28 Oct 2025 10:32:05 -0400 Subject: [PATCH 2/2] add changeset --- .changeset/hot-clowns-yell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hot-clowns-yell.md diff --git a/.changeset/hot-clowns-yell.md b/.changeset/hot-clowns-yell.md new file mode 100644 index 00000000000..797a0fc9381 --- /dev/null +++ b/.changeset/hot-clowns-yell.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Only render last use strategy badge when there is a last used strategy available and there is more than one strategy enabled.