FIX 纠正drone授权流程

This commit is contained in:
Jasder
2020-10-15 17:00:02 +08:00
parent 38ca183bcd
commit 0c2c917c7f
2 changed files with 18 additions and 4 deletions

View File

@@ -87,7 +87,10 @@ class Ci::CloudAccountsController < Ci::BaseController
password = params[:password].to_s
return render_error('你输入的密码不正确.') unless current_user.check_password?(password)
result = gitea_oauth_grant!(current_user.login, password, @cloud_account.drone_url, current_user.oauths.last&.client_id)
oauth = current_user.oauths.last
return render_error("服务器出小差了.") if oauth.blank?
result = gitea_oauth_grant!(password, oauth)
result === true ? render_ok : render_error('授权失败.')
end