Class: OmniauthCallbacksController
- Inherits:
-
Devise::OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- OmniauthCallbacksController
- Defined in:
- app/controllers/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#doorkeeper ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/omniauth_callbacks_controller.rb', line 3 def doorkeeper oauth_data = request.env["omniauth.auth"] @user = User.find_or_create_for_doorkeeper_oauth(oauth_data) @user.update_doorkeeper_credentials(oauth_data) @user.save xmpp_credentials = sign_in_as @user ap xmpp_credentials flash[:attacher] = xmpp_credentials # if @user.identities.find_by(provider:"github").nil? # @user.identities.create(provider:"github",auth_token:oauth_data.info.github_auth_token,email:oauth_data.info.github_email) # end sign_in @user redirect_to dashboard_path end |