mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
Merge branch 'standalone_develop' into pre_trustie_server
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
config = Rails.application.config_for(:configuration)
|
||||
|
||||
OmniAuth.config.add_camelization 'qq', 'QQ' if config.dig("oauth", "qq")
|
||||
OmniAuth.config.add_camelization 'github', 'GitHub' if config.dig("oauth", "github")
|
||||
OmniAuth.config.add_camelization 'gitee', 'Gitee' if config.dig("oauth", "gitee")
|
||||
OmniAuth.config.add_camelization 'wechat', 'Wechat' if config.dig("oauth", "wechat")
|
||||
# OmniAuth.config.add_camelization 'github', 'GitHub' if config.dig("oauth", "github")
|
||||
# OmniAuth.config.add_camelization 'gitee', 'Gitee' if config.dig("oauth", "gitee")
|
||||
# OmniAuth.config.add_camelization 'wechat', 'Wechat' if config.dig("oauth", "wechat")
|
||||
OmniAuth.config.logger = Rails.logger
|
||||
OmniAuth.config.allowed_request_methods = %i[get post]
|
||||
OmniAuth.config.before_request_phase = nil
|
||||
OmniAuth.config.before_callback_phase = nil
|
||||
OmniAuth.config.on_failure = Proc.new { |env|
|
||||
@@ -22,6 +23,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
||||
provider :gitee, config.dig("oauth", "gitee", "appid"), config.dig("oauth", "gitee", "secret"), { provider_ignores_state: true, scope: "user_info emails" }
|
||||
end
|
||||
if config.dig("oauth", "wechat").present?
|
||||
provider :gitee, config.dig("oauth", "wechat", "appid"), config.dig("oauth", "wechat", "secret"), { provider_ignores_state: true, scope: "snsapi_login" }
|
||||
provider :wechat, config.dig("oauth", "wechat", "appid"), config.dig("oauth", "wechat", "secret"), { provider_ignores_state: true, scope: "snsapi_login" }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ Rails.application.routes.draw do
|
||||
get 'attachments/download/:id', to: 'attachments#show'
|
||||
get 'attachments/download/:id/:filename', to: 'attachments#show'
|
||||
|
||||
get 'auth/qq/callback', to: 'oauth/qq#create'
|
||||
# get 'auth/qq/callback', to: 'oauth/qq#create'
|
||||
get 'auth/failure', to: 'oauth/base#auth_failure'
|
||||
get 'auth/cas/callback', to: 'oauth/cas#create'
|
||||
get 'auth/:provider/callback', to: 'oauth/callbacks#create'
|
||||
|
||||
@@ -54,6 +54,7 @@ defaults format: :json do
|
||||
end
|
||||
end
|
||||
resources :commits, only: [:index]
|
||||
resources :code_stats, only: [:index]
|
||||
get '/commits/:sha/diff', to: 'commits#diff'
|
||||
get '/git/blobs/:sha', to: 'git#blobs'
|
||||
get '/git/trees/:sha', to: 'git#trees'
|
||||
|
||||
Reference in New Issue
Block a user