fix: handle missing sso provider configuration on settings pages #132
No reviewers
Labels
No labels
auto-merge
bug
chore
dependency
duplicate
enhancement
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
hobbypunk/rails-base_app!132
Loading…
Reference in a new issue
No description provided.
Delete branch "bug/34"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
GlitchTip reported a
NoMethodError: undefined method 'keys' for nilinrender_sso_providers(app/views/settings/security/edit.rb) – reported as hobbypunk/centinel#34.Configurations.auth.providersisnilwhen no SSO providers are configured (e.g. Centinel runs proxy auth only). While the home page and the OmniAuth initializer already guard withkey?(:providers), both settings pages accessedprovidersunguarded.config/settings/test.ymleven documented the crash („Settings pages crash with nil.providers") and masked it in the test env with a workaround instead of a fix.Changes
app/views/settings/security/edit.rb:render_sso_providersreturns early whenauth.providersis missing or empty, and only renders identities of still-configured providers – this also fixes the adjacent crash when a provider was removed from the config while user identities remain.app/views/settings/profile/edit.rb:translate_avatar_typeaccessesauth.providersnil-safely.app/models/user/profile.rb:avatar_typesfilters identity providers that are not (anymore) inauth.providers– rendered avatar options and theavatar_typeinclusion validation stay consistent with the configuration.config/settings/test.yml: removed the now-obsolete crash remark from the comment.Closes hobbypunk/centinel#34
📊 Coverage
Patch-Coverage: 100.0% (11/11 geänderte Zeilen)
Geänderte Dateien (schwach zuerst)
Schwächste Dateien im Projekt
🔍 Report im Browser ansehen · 📄 Run-Artifact „coverage-report“