feat: SAML feedback changes [CW-5666] (#12511)

This commit is contained in:
Shivam Mishra
2025-09-24 16:07:07 +05:30
committed by GitHub
parent eadbddaa9f
commit d3cd647e49
18 changed files with 116 additions and 78 deletions

View File

@@ -44,6 +44,16 @@ class Api::V1::AuthController < Api::BaseController
end
def render_saml_error
render json: { error: I18n.t('auth.saml.authentication_failed') }, status: :unauthorized
redirect_to sso_login_page_url(error: 'saml-authentication-failed')
end
def sso_login_page_url(error: nil)
frontend_url = ENV.fetch('FRONTEND_URL', nil)
params = { error: error }.compact
query = params.to_query
query_fragment = query.present? ? "?#{query}" : ''
"#{frontend_url}/app/login/sso#{query_fragment}"
end
end

View File

@@ -22,7 +22,7 @@ class Enterprise::Billing::HandleStripeEventService
BUSINESS_PLAN_FEATURES = %w[sla custom_roles].freeze
# Additional features available only in the Enterprise plan
ENTERPRISE_PLAN_FEATURES = %w[audit_logs disable_branding].freeze
ENTERPRISE_PLAN_FEATURES = %w[audit_logs disable_branding saml].freeze
def perform(event:)
@event = event