调整Bot授权接口

This commit is contained in:
xxq250 2023-02-16 09:41:39 +08:00
parent c0fcf3445a
commit 1d9df770b5
1 changed files with 16 additions and 15 deletions

View File

@ -7,6 +7,7 @@ class InstallationsController < ApplicationController
end end
def auth_active def auth_active
begin
@bot = Bot.find params[:id] @bot = Bot.find params[:id]
@bot.client_id = Doorkeeper::OAuth::Helpers::UniqueToken.generate if params[:client_id].blank? @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.client_secret = Doorkeeper::OAuth::Helpers::UniqueToken.generate if params[:client_secret].blank?