diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index d70c7fefe6c..e9f23ca7173 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -115,7 +115,7 @@ class Users::OmniauthCallbacksController < ApplicationController if @auth_result.email_valid && @auth_result.email == user.email user.update!(staged: false) # ensure there is an active email token - user.email_tokens.create(email: user.email) unless user.email_tokens.active.where(email: user.email).exists? + user.email_tokens.create(email: user.email) unless EmailToken.where(email: user.email, confirmed: true).present? || user.email_tokens.active.where(email: user.email).exists? user.activate end