Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Not requiring user to login when associating with an existing account…

… if email matches
  • Loading branch information...
commit a7774cf39476521bffe484a94667a2283a1911fc 1 parent ff268b3
@danmorin authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/controllers/spree/omniauth_callbacks_controller.rb
6 app/controllers/spree/omniauth_callbacks_controller.rb
@@ -32,6 +32,12 @@ def social_setup(provider)
#signing back in from a social source
if existing_auth
user = existing_auth.user
+ elsif omniauth['user_info'] && user = Spree::User.find_by_email(omniauth['user_info']['email'].downcase)
+ Rails.logger.error "\n\n\nFound: #{user.inspect}\n\n\n"
+ # If their email address matches their facebook email, it's safe to assume it's the user
+ # so we're not making them enter a password to authenticate first
+ # Since we assign user in the IF, there's nothing more to do here :)
else # adding a social source
user = current_user
Please sign in to comment.
Something went wrong with that request. Please try again.