diff --git a/app/lib/warden/barcode_auth_strategy.rb b/app/lib/warden/barcode_auth_strategy.rb index dd24103..432fe97 100644 --- a/app/lib/warden/barcode_auth_strategy.rb +++ b/app/lib/warden/barcode_auth_strategy.rb @@ -22,7 +22,7 @@ def authenticate! if local_user_by_univ_id && local_user_by_username && local_user_by_univ_id.id != local_user_by_username.id Rails.logger.debug "Found 2 conflicting user records in db. ID: #{local_user_by_univ_id.id } and #{local_user_by_username.id }." Rails.logger.debug "fail BarcodeAuthStrategy.authenticate #{user_id}" - fail!('Invalid user account.') + fail!(:invalid) return validate(resource) { false } end diff --git a/app/lib/warden/ppy_auth_strategy.rb b/app/lib/warden/ppy_auth_strategy.rb index df113ac..7c8df41 100644 --- a/app/lib/warden/ppy_auth_strategy.rb +++ b/app/lib/warden/ppy_auth_strategy.rb @@ -15,7 +15,7 @@ def authenticate! alma_user = Warden::PpyAuthStrategy.find_alma_user_matching_py_cyin(request) if alma_user.nil? - fail!("User not found in Alma") + fail!(:invalid) return validate(resource) { false } end @@ -27,7 +27,7 @@ def authenticate! if local_user_by_univ_id && local_user_by_username && local_user_by_univ_id.id != local_user_by_username.id Rails.logger.debug "Found 2 conflicting user records in db. ID: #{local_user_by_univ_id.id } and #{local_user_by_username.id }." Rails.logger.debug "fail PpyAuthStrategy.authenticate #{user_id}" - fail!('Invalid user account.') + fail!(:invalid) return validate(resource) { false } end @@ -53,7 +53,8 @@ def authenticate! success!(local_user) else Rails.logger.debug "fail PpyAuthStrategy.authenticate - No PY Headers present" - fail!("Not authenticated by Passport York") + fail!(:invalid) + return validate(resource) { false } end end