qweewq
@qweewq
ruby, ruby on rails, devops

Очень медленная авторизация через Facebook?

По каким-то пока не понятным причинам facebook отвечает оочень медленно: cl.ly/Gou0.

Я использую OmniAuth, код выглядит так:
class AuthenticationsController < ApplicationController
...
  def create
    auth = auth_hash

    if current_user
      # If logged in, then try to add an authentication
      current_user.authentications.find_or_create_by_provider_and_uid_and_auth_token(auth['provider'], auth['uid'], auth['credentials']['token'])

    else
      # If not logged in, check, if has been logged in earlier
      authentication = Authentication.find_by_provider_and_uid(auth['provider'], auth['uid'])

      if authentication.nil?
        #  If not, create User
        u = User.create_with_omniauth(auth)
        u.authentications.create!(provider: auth['provider'], uid: auth['uid'], auth_token: auth['credentials']['token'])

      else
        # Else log in with existing user
        u = User.find(authentication.user_id)
      end

      session[:user_id] = u.id
      dependent_respond
    end
  end
end


Где я неправ?
  • Вопрос задан
  • 3107 просмотров
Пригласить эксперта
Ответы на вопрос 1
andreysmind
@andreysmind
не сталкивался. правда у меня аутентификация проверяется через signed_request.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы