Class: OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
app/controllers/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#doorkeeperObject



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 =  @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
   @user
  redirect_to dashboard_path
end