Skip to content

Commit

Permalink
fixup! Fix users sign in (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitallium committed Feb 20, 2018
1 parent 422ddc6 commit 703a354
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ class User < ApplicationRecord

def self.from_omniauth!(auth)
auth_info = auth.info
user = User.find_or_initialize_by(email: auth_info.email)
email = auth_info.email.downcase if auth_info.email.present?
user = User.find_or_initialize_by(email: email)

if user.new_record?
user.email = auth_info.email
user.email = email
user.name = auth_info.name
user.first_name = auth_info.first_name
user.last_name = auth_info.last_name
Expand Down

0 comments on commit 703a354

Please sign in to comment.