From 676d2ddce138ea3989c66143b8347cefe352677b Mon Sep 17 00:00:00 2001 From: xxq250 Date: Thu, 16 Feb 2023 13:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4Bot=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/installations_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/installations_controller.rb b/app/controllers/installations_controller.rb index 88c43cf6..dd7253f2 100644 --- a/app/controllers/installations_controller.rb +++ b/app/controllers/installations_controller.rb @@ -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