diff --git a/Gemfile.lock b/Gemfile.lock index 9654986..35e5a8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,8 +183,7 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-protobuf (3.23.4-aarch64-linux) - google-protobuf (3.23.4-x86_64-linux) + google-protobuf (3.21.12) googleapis-common-protos-types (1.6.0) google-protobuf (~> 3.14) googleauth (1.6.0) diff --git a/app/models/authority.rb b/app/models/authority.rb index de2a58f..781bfa0 100644 --- a/app/models/authority.rb +++ b/app/models/authority.rb @@ -44,4 +44,8 @@ def get_storage config.residencies[0] end end + + def get_callback_uri + internals["default_callback_uri"] + end end diff --git a/docker-compose.yml b/docker-compose.yml index ef26386..7f785c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,9 +20,6 @@ services: POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_DB: place_development - healthcheck: - test: /usr/bin/pg_isready - interval: 5s ports: - 5432:5432 diff --git a/lib/omniauth/strategies/generic_oauth.rb b/lib/omniauth/strategies/generic_oauth.rb index 4404727..b6e740d 100644 --- a/lib/omniauth/strategies/generic_oauth.rb +++ b/lib/omniauth/strategies/generic_oauth.rb @@ -45,7 +45,8 @@ def request_phase end def callback_phase - authid = request.params["id"] + authority = Authority.find_by_domain(request.host) + authid = request.params["id"] || (authority.get_callback_uri || OauthStrat.where(authority_id: authority.id).order(:id).first.try(:id)) # Set out details once again if authid.nil?