Browse Source

FIX devops pwd auth bug

tags/v1.0.0
Jasder 5 years ago
parent
commit
64a3ab24e2
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      README.md
  2. +2
    -1
      app/controllers/ci/cloud_accounts_controller.rb

+ 1
- 1
README.md View File

@@ -2640,7 +2640,7 @@ GET /api/users/ci/oauth_grant
*示例*
```
curl -X GET \
-d "password=123456"
-d "password=123456" \
http://localhost:3000/api/users/ci/oauth_grant.json | jq
```
*请求参数说明:*


+ 2
- 1
app/controllers/ci/cloud_accounts_controller.rb View File

@@ -84,7 +84,8 @@ class Ci::CloudAccountsController < Ci::BaseController
end

def oauth_grant
return render_error('你输入的密码不正确.') unless current_user.check_password?(params[:password].to_s)
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)
result === true ? render_ok : render_error('授权失败.')


Loading…
Cancel
Save