Browse Source

调整Bot授权接口

pull/342/head
xxq250 3 years ago
parent
commit
676d2ddce1
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      app/controllers/installations_controller.rb

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

@@ -28,6 +28,7 @@ class InstallationsController < ApplicationController
def auth_active
begin
@bot = Bot.find params[:id]
tip_exception("该Bot已激活") if Doorkeeper::Application.find_by(uid: @bot.client_id, secret: @bot.client_secret).present?
@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?
@bot.private_key = OpenSSL::PKey::RSA::generate(2048).to_s


Loading…
Cancel
Save