improve registration and add oauth
This commit is contained in:
@@ -266,7 +266,7 @@ 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.fetch('GOOGLE_CLIENT_ID', nil), ENV.fetch('GOOGLE_CLIENT_SECRET', nil), {}
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
|
||||
+9
-2
@@ -5,11 +5,18 @@ Rails.application.routes.draw do
|
||||
|
||||
root 'dashboard#index'
|
||||
|
||||
devise_for :users, path: '/', only: %i[sessions passwords]
|
||||
devise_for :users,
|
||||
path: '/', only: %i[sessions passwords omniauth_callbacks],
|
||||
controllers: begin
|
||||
options = { sessions: 'sessions' }
|
||||
options[:omniauth_callbacks] = 'omniauth_callbacks' if Docuseal.multitenant?
|
||||
options
|
||||
end
|
||||
|
||||
devise_scope :user do
|
||||
if Docuseal.multitenant?
|
||||
resource :registration, only: %i[create], path: 'sign_up' do
|
||||
resource :registration, only: %i[show], path: 'sign_up'
|
||||
resource :registration, only: %i[create], path: 'new' do
|
||||
get '' => :new, as: :new
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user