fixed 第三方授权登录配置url

This commit is contained in:
xxq250 2022-12-06 10:12:41 +08:00
parent e41adbc4a8
commit 73d89a89e2
2 changed files with 3 additions and 2 deletions

View File

@ -76,11 +76,12 @@ class SettingsController < ApplicationController
url: EducoderOauth.oauth_url,
method: 'get'
}
platform_url = Rails.application.config_for(:configuration)['platform_url']
config = Rails.application.config_for(:configuration)
(config.dig("oauth").keys - ["educoder"]).each do |provider|
@third_party_new << {
name: provider,
url: "/auth/#{provider}",
url: "#{platform_url}/auth/#{provider}",
method: 'post'
}
end

View File

@ -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'