Class: Omnisand::OmniauthCallbacksController
- Inherits:
-
Devise::OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- Omnisand::OmniauthCallbacksController
- Defined in:
- app/controllers/omnisand/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#callback ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/omnisand/omniauth_callbacks_controller.rb', line 3 def callback omniauth = request.env['omniauth.auth'] @authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid']) if @authentication @user = @authentication.user else # New User @user = User.new end @user.set_params omniauth sign_in(:user, @user) redirect_to '/' end |