Skip to content

Commit

Permalink
Remove copy_flash_to_response_headers() (no longer used)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dolski committed Jan 5, 2024
1 parent 1303038 commit a3fe7f8
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class ApplicationController < ActionController::Base
rescue_from NotFoundError, with: :rescue_not_found

before_action :redirect_to_main_host, :log_out_disabled_user
after_action :copy_flash_to_response_headers

layout -> { institution_host? ? "application_scoped" : "application_global" }

Expand Down Expand Up @@ -401,23 +400,8 @@ def window_size
client
end

private

##
# Stores the flash message and type (`error` or `success`) in the response
# headers, where they can be accessed from a JavaScript AJAX callback.
#
def copy_flash_to_response_headers
if request.xhr?
if flash['error'].present?
response.headers['X-Ideals-Message-Type'] = 'error'
response.headers['X-Ideals-Message'] = flash['error']
elsif flash['success'].present?
response.headers['X-Ideals-Message-Type'] = 'success'
response.headers['X-Ideals-Message'] = flash['success']
end
end
end
private

##
# When a user account is disabled, the user is prevented from logging in (via
Expand Down

0 comments on commit a3fe7f8

Please sign in to comment.