|
|
|
@@ -37,7 +37,7 @@ class InstallationsController < ApplicationController |
|
|
|
# 注册bot对应oauth应用 |
|
|
|
Doorkeeper::Application.create!(name: @bot.name, uid: @bot.client_id, secret: @bot.client_secret, redirect_uri: "https://gitlink.org.cn") |
|
|
|
# 注册bot对应用户 |
|
|
|
result = autologin_register(User.generate_user_login('b'), nil, "b58333123413", 'bot', nickname: @bot.name) |
|
|
|
result = autologin_register(User.generate_user_login('b'), nil, "#{SecureRandom.hex(6)}", 'bot', nickname: @bot.name) |
|
|
|
tip_exception(-1, result[:message]) if result[:message].present? |
|
|
|
@bot.uid = result[:user][:id] |
|
|
|
@bot.save |
|
|
|
|