orbit-4-2/app/controllers/admin/omniauth_callbacks_controll...

10 lines
315 B
Ruby
Raw Permalink Normal View History

2014-02-11 10:14:45 +00:00
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
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
sign_in_and_redirect @user
end
end