Skip to content

Commit

Permalink
Remove query_string from redirect_uri and send locale in kc_locale param
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed May 27, 2024
1 parent d04287e commit 8ac928d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/omniauth/strategies/odoo_keycloak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ class OdooKeycloak < OmniAuth::Strategies::KeycloakOpenId
def odoo_info
@odoo_info ||= ::Decidim::Odoo::Api::FindPartnerByVat.new(raw_info["preferred_username"]).result
end

def authorize_params
super.tap do |param|
param[:kc_locale] = current_locale
end
end

def query_string
""
end

private

def current_locale
request.params["locale"] || I18n.default_locale
end
end
end
end

0 comments on commit 8ac928d

Please sign in to comment.