Browse Source

fixed 第三方授权登录配置url

pull/313/head
xxq250 3 years ago
parent
commit
73d89a89e2
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      app/controllers/settings_controller.rb
  2. +1
    -1
      config/routes.rb

+ 2
- 1
app/controllers/settings_controller.rb 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


+ 1
- 1
config/routes.rb 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'


Loading…
Cancel
Save