Skip to content

Commit

Permalink
Add remembering of user when he logs from omniauth
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlON committed Mar 21, 2017
1 parent 2466252 commit a80f358
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def self.from_omniauth(auth)
if where(email: auth.info.email).exists?
user = find_by(email: auth.info.email)
user.update(provider: auth.provider, uid: auth.uid, photo_url: auth.info.image)
user.remember_me!
return user
end

create(email: auth.info.email,
create(email: auth.info.email, name: auth.info.name,
password: Devise.friendly_token[0, 20],
name: auth.info.name,
provider: auth.provider, uid: auth.uid,
photo_url: auth.info.image)
end
Expand Down

0 comments on commit a80f358

Please sign in to comment.