mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
FIX Adjust call gitea api for security
This commit is contained in:
@@ -22,7 +22,7 @@ module Gitea
|
||||
|
||||
def run
|
||||
Gitea::UserForm.new(params).validate!
|
||||
response = Gitea::User::RegisterService.new(params).call
|
||||
response = Gitea::User::RegisterService.call(params.merge(token: token))
|
||||
render_result(response)
|
||||
rescue Exception => exception
|
||||
Rails.logger.info "Exception ===========> #{exception.message}"
|
||||
@@ -41,5 +41,12 @@ module Gitea
|
||||
def render_result(response)
|
||||
@result = response
|
||||
end
|
||||
|
||||
def token
|
||||
{
|
||||
username: Gitea.gitea_config[:access_key_id],
|
||||
password: Gitea.gitea_config[:access_key_secret]
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user