lib/authlogic_connect/oauth/user.rb in authlogic-connect-0.0.3.3 vs lib/authlogic_connect/oauth/user.rb in authlogic-connect-0.0.3.4
- old
+ new
@@ -68,10 +68,12 @@
def authenticate_with_oauth
# Restore any attributes which were saved before redirecting to the oauth server
self.attributes = auth_session.delete(:authlogic_oauth_attributes)
token = AuthlogicConnect.token(oauth_provider).new(oauth_key_and_secret)
- if Token.find_by_key(token.key)
+ puts "NEW TOKEN: #{token.inspect}"
+ if old_token = Token.find_by_key(token.key)
+ puts "OLD TOKEN? #{old_token.inspect}"
self.errors.add("you have already created an account using your #{oauth_token.service_name} account, so it")
else
self.tokens << token
self.active_token = token
end
\ No newline at end of file