From 8ac928d84f124e2f17a289784908f9ae619fdfbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Mon, 27 May 2024 13:21:16 +0200 Subject: [PATCH] Remove query_string from redirect_uri and send locale in kc_locale param --- lib/omniauth/strategies/odoo_keycloak.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/omniauth/strategies/odoo_keycloak.rb b/lib/omniauth/strategies/odoo_keycloak.rb index 8b76573..7ef0a53 100644 --- a/lib/omniauth/strategies/odoo_keycloak.rb +++ b/lib/omniauth/strategies/odoo_keycloak.rb @@ -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