Skip to content

Commit

Permalink
fix use of wrong methode
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianAppDev authored Aug 2, 2024
1 parent 28cf3ab commit ffd95c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/external_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def create_user
user = User.find_by(external_id: credentials['uid'], provider:)

# Fallback mechanism to search by email
if user.blank? && ENV['USE_EMAIL_AS_EXTERNAL_ID_FALLBACK'].value(true)
if user.blank? && ENV.fetch('USE_EMAIL_AS_EXTERNAL_ID_FALLBACK', 'false') == 'true'
user = User.find_by(email: credentials['info']['email'], provider:)
# Update the user's external id to the latest value to avoid using the fallback
user.update(external_id: credentials['uid']) if user.present? && credentials['uid'].present?
Expand Down

0 comments on commit ffd95c6

Please sign in to comment.