Skip to content

Commit

Permalink
Release 14/06/21 (#791)
Browse files Browse the repository at this point in the history
* Bugfix bypass sso parity on api endpoints (#784)

* Bypass sso parity on API endpoints

* Add skip_before_action callbacks to controllers where SSO parity is not needed

* Block enquiries and enquiry responses for maintenance (#785)

* Disable SSO parity enforcement (#787)

* Remove skip hooks

* Re-enable enquiries and responses (#790)
  • Loading branch information
rafa-garcia authored Jun 14, 2021
1 parent 77cca42 commit 6cd17c4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions app/controllers/admin/enquiry_responses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class Admin::EnquiryResponsesController < Admin::BaseController
skip_before_action :authenticate_editor!, raise: false

def new
return redirect_to 'https://www.great.gov.uk/under-maintenance/'

@enquiry ||= Enquiry.find(params.fetch(:id, nil))
@companies_house_url ||= companies_house_url(@enquiry.company_house_number)
@enquiry_response = EnquiryResponse.find_or_initialize_by(enquiry_id: @enquiry.id)
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/enquiries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ class EnquiriesController < ApplicationController
before_action :log_cloudfront_headers

def new
return redirect_to 'https://www.great.gov.uk/under-maintenance/'

@opportunity = Opportunity.published.find_by!(slug: params[:slug])
@enquiry = Enquiry.new_from_sso(cookies[Figaro.env.SSO_SESSION_COOKIE])
if @opportunity.expired?
Expand Down
1 change: 1 addition & 0 deletions app/controllers/users/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def magna
sso_id = cookies[sso_session_cookie]
if sso_user = DirectoryApiClient.user_data(sso_id)
request.env['omniauth.auth']['info'] = sso_user
request.env['omniauth.auth']['uid'] = sso_user['id']
@user = User.from_omniauth(request.env['omniauth.auth'])
sign_in_and_redirect @user
set_flash_message(:notice, :success) if is_navigational_format?
Expand Down

0 comments on commit 6cd17c4

Please sign in to comment.