Skip to content

fix: Harmonize SSO Buttons - #1012

Open
AyakorK wants to merge 1 commit into
developfrom
fix/omniauth_buttons_optimizations
Open

fix: Harmonize SSO Buttons#1012
AyakorK wants to merge 1 commit into
developfrom
fix/omniauth_buttons_optimizations

Conversation

@AyakorK

@AyakorK AyakorK commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🎩 Description

Unifies the SSO login button override mechanism across all omniauth providers. Previously each provider had its own strategy: FranceConnect hardcoded an image-only partial, Publik hacked the shared log_in_with_provider Term Customizer key, others only checked display_name, and the default fallback truncated the provider name ("France" instead of "France Connect").

Now every provider goes through one cascade in omniauth_provider_label: a per-provider Term Customizer translation → display_name -> a proper humanized name. Icon handling is unified too: any provider with icon_path + icon_hover_path configured gets the full-image button treatment, and a safe generic icon fallback prevents crashes when nothing is configured, including a real NoMethodError crash in decidim-core's oauth_icon for any provider not registered in Decidim.omniauth_providers.

Testing

  • Activate the SSOs you want to test in the system view
  • Visit the login/registration page and confirm every button renders without error (icon or fallback icon)
  • Confirm FranceConnect still renders as a full image button, and other providers show a proper full name ("Cultuur Connect", not "Cultuur")
  • In Term Customizer, override decidim.devise.shared.links.provider_display_name_<provider> for a provider, run the GLOBAL cache cleaner (the term customizer "cache cleaner" button only clears the participatory processes related so it might not work), and confirm the button text updates

📌 Related Issues

Tasks

  • Added specs for the provider label cascade and icon fallback logic (omniauth_helper_spec.rb)
  • Added a system spec confirming every configured omniauth button renders without a server error
  • Registered log_in_with_provider and provider_display_name in config/i18n-tasks.yml so they aren't flagged as unused, since they're referenced dynamically with an interpolated provider name rather than called literally in the code

@AyakorK
AyakorK marked this pull request as ready for review July 29, 2026 13:04
@AyakorK
AyakorK requested a review from moustachu July 29, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant