add oauth with google
This commit is contained in:
@@ -18,6 +18,10 @@ require "action_cable/engine"
|
||||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(*Rails.groups)
|
||||
|
||||
if ['development', 'test'].include? ENV['RAILS_ENV']
|
||||
Dotenv::Railtie.load
|
||||
end
|
||||
|
||||
module ProgressTest
|
||||
class Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
|
||||
@@ -271,7 +271,12 @@ Devise.setup do |config|
|
||||
# ==> OmniAuth
|
||||
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
||||
# up on your models and hooks.
|
||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||
config.omniauth(
|
||||
:google_oauth2,
|
||||
ENV['GOOGLE_OAUTH_CLIENT_ID'],
|
||||
ENV['GOOGLE_OAUTH_CLIENT_SECRET'],
|
||||
{}
|
||||
)
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Rails.application.routes.draw do
|
||||
devise_for :users
|
||||
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
|
||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||
|
||||
# Defines the root path route ("/")
|
||||
|
||||
Reference in New Issue
Block a user