Skip to content

Commit

Permalink
Merge pull request #1044 from sul-dlss/patron-key
Browse files Browse the repository at this point in the history
Remove code that checks for old sessions with Symphony patron keys
  • Loading branch information
jcoyne authored Feb 13, 2024
2 parents a782952 + 03940bc commit 30dfcc5
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 @@ -3,7 +3,7 @@
# :nodoc:
class ApplicationController < ActionController::Base
helper_method :current_user, :current_user?, :patron, :patron_or_group
before_action :set_internal_pages_flash_message, :check_unavailable, :check_sym_patron_key
before_action :set_internal_pages_flash_message, :check_unavailable

class_attribute :ils_client_class, default: Settings.ils.client.constantize
class_attribute :ils_patron_model_class, default: Settings.ils.patron_model.constantize
Expand Down Expand Up @@ -44,22 +44,6 @@ def check_unavailable
redirect_to unavailable_path unless ils_client.ping
end

# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
def check_sym_patron_key
return if request.path == root_path || current_user&.patron_key.blank? || symphony?

# Symphony used numeric patron keys; FOLIO uses UUIDs
return unless current_user&.patron_key&.match?(/\A[+-]?\d+\Z/)

request.env['warden'].logout
redirect_to root_url
end
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity

def symphony?
Settings.ils.client == 'SymphonyClient'
end

def patron_info_response
ils_client.patron_info(current_user.patron_key, item_details:)
end
Expand Down

0 comments on commit 30dfcc5

Please sign in to comment.