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

39 lines
793 B
Ruby

# 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
end
private
def auth_hash
request.env['omniauth.auth']
end
# The path used when OmniAuth fails
# def after_omniauth_failure_path_for(scope)
# super(scope)
# end
end