Commit 27be061a authored by Eugen Rochko's avatar Eugen Rochko

Fix re-logins

parent a4d7a83e
......@@ -6,7 +6,7 @@ class User < ApplicationRecord
class << self
def from_omniauth(auth, current_user)
authorization = Authorization.where(provider: auth.provider, uid: auth.uid.to_s).first_or_initialize
user = current_user || User.new
user = current_user || authorization.user || User.new
authorization.user = user
authorization.token = auth.credentials.token
authorization.secret = auth.credentials.secret
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment