mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
refactor: remove SSO settings page; consolidate SSO identity management under Security settings
- Removed the `Settings::SsoIdentitiesController` and views for a simplified user experience. - Moved SSO identity management to the Security settings page (`Settings::SecuritiesController`). - Updated locale keys and layout for the new structure. - Fixed unlink protection warnings and adjusted redirection path. - Cleaned up routes, helper methods, and redundant code.
This commit is contained in:
@@ -3,20 +3,12 @@
|
||||
class Settings::SsoIdentitiesController < ApplicationController
|
||||
layout "settings"
|
||||
|
||||
def show
|
||||
@oidc_identities = Current.user.oidc_identities.order(:provider)
|
||||
@breadcrumbs = [
|
||||
[ t("settings.nav.home"), root_path ],
|
||||
[ t(".page_title"), nil ]
|
||||
]
|
||||
end
|
||||
|
||||
def destroy
|
||||
@identity = Current.user.oidc_identities.find(params[:id])
|
||||
|
||||
# Prevent unlinking last identity if user has no password
|
||||
if Current.user.oidc_identities.count == 1 && Current.user.password_digest.blank?
|
||||
redirect_to settings_sso_identities_path, alert: t(".cannot_unlink_last")
|
||||
redirect_to settings_security_path, alert: t(".cannot_unlink_last")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -30,6 +22,6 @@ class Settings::SsoIdentitiesController < ApplicationController
|
||||
request: request
|
||||
)
|
||||
|
||||
redirect_to settings_sso_identities_path, notice: t(".success", provider: provider_name)
|
||||
redirect_to settings_security_path, notice: t(".success", provider: provider_name)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user