Skip to content

Commit 0008d9b

Browse files
committed
FIX: Correct order of operations in if statement
1 parent 6d2ac4a commit 0008d9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def after_authenticate(auth_token)
3434

3535
association = UserAssociatedAccount.find_by(provider_name: auth_token[:provider], provider_uid: auth_token[:uid])
3636

37-
if match_by_email && association.nil? && user = User.find_by_email(email) && !UserAssociatedAccount.exists?(user: user, provider_name: auth_token[:provider])
37+
if match_by_email && association.nil? && (user = User.find_by_email(email)) && !UserAssociatedAccount.exists?(user: user, provider_name: auth_token[:provider])
3838
association = UserAssociatedAccount.create!(user: user, provider_name: auth_token[:provider], provider_uid: auth_token[:uid], info: auth_token[:info], credentials: auth_token[:credentials], extra: auth_token[:extra])
3939
end
4040

0 commit comments

Comments
 (0)