Browse Source

调整Bot授权接口

pull/342/head
xxq250 3 years ago
parent
commit
6fe16c7c82
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/installations_controller.rb
  2. +1
    -1
      config/routes.rb

+ 1
- 1
app/controllers/installations_controller.rb View File

@@ -6,7 +6,7 @@ class InstallationsController < ApplicationController
@install_bots = BotInstall.where(:installer_id => current_user.id)
end

def register
def auth_active
@bot = Bot.find params[:id]
@bot.client_id = Doorkeeper::OAuth::Helpers::UniqueToken.generate if params[:client_id].blank?
@bot.client_secret = Doorkeeper::OAuth::Helpers::UniqueToken.generate if params[:client_secret].blank?


+ 1
- 1
config/routes.rb View File

@@ -1048,7 +1048,7 @@ Rails.application.routes.draw do
resources :commit_logs, :only => [:create]

scope '/app' do
post 'register', to: 'installations#register'
post 'auth_active', to: 'installations#auth_active'
resources :installations do
get :repositories, on: :collection
member do


Loading…
Cancel
Save