Extract variable in manager authenticator method

This commit is contained in:
Javi Martín
2023-07-19 15:53:06 +02:00
parent 4b374151be
commit 36c3ba6601

View File

@@ -22,7 +22,9 @@ class ManagerAuthenticator
def application_authorized?
response = client.call(:get_applications_user_list, message: { ub: { user_key: @manager[:user_key] }}).body
parsed_response = parser.parse((response[:get_applications_user_list_response][:get_applications_user_list_return]))
user_list_return = response[:get_applications_user_list_response][:get_applications_user_list_return]
parsed_response = parser.parse(user_list_return)
aplication_value = parsed_response["APLICACIONES"]["APLICACION"]
# aplication_value from UWEB can be an array of hashes or a hash
aplication_value.include?("CLAVE_APLICACION" => application_key) || aplication_value["CLAVE_APLICACION"] == application_key