FIX pwd bug
This commit is contained in:
parent
cfd285cbcd
commit
7b0f219a82
|
@ -84,14 +84,15 @@ class Ci::CloudAccountsController < Ci::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def oauth_grant
|
def oauth_grant
|
||||||
password = params[:password].to_s
|
password = params[:password].strip.to_s
|
||||||
return render_error('你输入的密码不正确.') unless current_user.check_password?(password)
|
return render_error('你输入的密码不正确.') unless current_user.check_password?(password)
|
||||||
|
|
||||||
oauth = current_user.oauths.last
|
oauth = current_user.oauths.last
|
||||||
return render_error("服务器出小差了.") if oauth.blank?
|
return render_error("服务器出小差了.") if oauth.blank?
|
||||||
|
|
||||||
result = gitea_oauth_grant!(password, oauth)
|
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
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
json.step current_user.devops_step
|
Loading…
Reference in New Issue