FIX pwd bug

This commit is contained in:
Jasder 2020-10-15 19:40:50 +08:00
parent cfd285cbcd
commit 7b0f219a82
2 changed files with 4 additions and 2 deletions

View File

@ -84,14 +84,15 @@ class Ci::CloudAccountsController < Ci::BaseController
end
def oauth_grant
password = params[:password].to_s
password = params[:password].strip.to_s
return render_error('你输入的密码不正确.') unless current_user.check_password?(password)
oauth = current_user.oauths.last
return render_error("服务器出小差了.") if oauth.blank?
result = gitea_oauth_grant!(password, oauth)
result === true ? render_ok : render_error('授权失败.')
return render_error('授权失败.') unless result === true
current_user.set_drone_step!(User::DEVOPS_CERTIFICATION)
end
private

View File

@ -0,0 +1 @@
json.step current_user.devops_step