diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index f3eedd0a1..e365c3e29 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -7,6 +7,7 @@ class SettingsController < ApplicationController get_sub_competitions get_personal_menu get_third_party + get_third_party_new get_top_system_notification end @@ -67,6 +68,23 @@ class SettingsController < ApplicationController url: EducoderOauth.oauth_url } end + + def get_third_party_new + @third_party_new = [] + @third_party_new << { + name: 'educoder', + url: EducoderOauth.oauth_url, + method: 'get' + } + config = Rails.application.config_for(:configuration) + (config.dig("oauth").keys - ["educoder"]).each do |provider| + @third_party_new << { + name: provider, + url: "/auth/#{provider}", + method: 'post' + } + end + end def get_top_system_notification @top_system_notification = SystemNotification.is_top.first diff --git a/app/views/settings/show.json.jbuilder b/app/views/settings/show.json.jbuilder index abe8207eb..be79dc594 100644 --- a/app/views/settings/show.json.jbuilder +++ b/app/views/settings/show.json.jbuilder @@ -61,6 +61,7 @@ json.setting do json.common @common json.third_party @third_party + json.third_party_new @third_party_new if @top_system_notification.present? json.system_notification do