1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) unable to save OpenID extra_authorize_params as json

This commit is contained in:
Du Peng 2023-10-12 14:14:13 +02:00
parent 8833fe593a
commit 2c7a37f770
3 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@
- Fix a bug: fix ReservationReminderWorker, was sending reservation reminder to users with a event reservation not validated by admin + adds tests for all scenarios
- Fix a bug: admin could not create new SupportingDocumentType (problem was on js side)
- Fix a bug: fix back button on space edit page
- Fix a bug: unable to save OpenID extra_authorize_params as json
## v6.1.2 2023 October 2

View File

@ -16,4 +16,16 @@ class OpenIdConnectProvider < ApplicationRecord
validates :display, inclusion: { in: %w[page popup touch wap], allow_nil: true }
validates :prompt, inclusion: { in: %w[none login consent select_account], allow_nil: true }
validates :client_auth_method, inclusion: { in: %w[basic jwks] }
store_accessor :extra_authorize_params
def extra_authorize_params=(val)
return unless val.is_a?(String)
begin
super JSON.parse(val)
rescue JSON::ParserError
errors[:extra_authorize_params].add('is not valid JSON')
super
end
end
end

View File

@ -16,6 +16,6 @@ if @provider.providable_type == OpenIdConnectProvider.name
:prompt, :send_scope_to_token_endpoint, :client__identifier, :client__secret, :client__authorization_endpoint,
:client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url
json.scope @provider.providable[:scope]
json.extra_authorize_params @provider.providable[:extra_authorize_params]
json.extra_authorize_params @provider.providable[:extra_authorize_params].to_json
end
end