1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/users/omniauth_callbacks_controller.rb

39 lines
793 B
Ruby
Raw Normal View History

2018-12-03 21:40:12 -05:00
# frozen_string_literal: true
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
skip_after_action :verify_authorized
skip_after_action :verify_policy_scoped
# GET|POST /resource/auth/:provider
# def passthru
# super
# end
# GET|POST /users/auth/:provider/callback
# def failure
# super
# end
# GET|POST /users/auth/github/callback
def github
context = AuthenticateUserWithOmniauth.call(
provider: auth_hash.provider,
remote_id: auth_hash.uid,
email: auth_hash.info.email,
)
sign_in_and_redirect context.user
2018-12-03 21:40:12 -05:00
end
private
def auth_hash
request.env['omniauth.auth']
end
2018-12-03 21:40:12 -05:00
# The path used when OmniAuth fails
# def after_omniauth_failure_path_for(scope)
# super(scope)
# end
end