forked from Trustie/forgeplus
修复:导入仓库密码为严格base64
This commit is contained in:
parent
cc05584245
commit
4fe2dc6b28
|
|
@ -32,7 +32,7 @@ class Repositories::MigrateService < ApplicationService
|
|||
private: params[:hidden],
|
||||
mirror: wrapper_mirror || false,
|
||||
auth_username: params[:login],
|
||||
auth_password: Base64.decode64(params[:password] || ""),
|
||||
auth_password: base64_decode_password,
|
||||
auth_token: params[:auth_token],
|
||||
service: params[:service] || 'git',
|
||||
}
|
||||
|
|
@ -41,4 +41,10 @@ class Repositories::MigrateService < ApplicationService
|
|||
def wrapper_mirror
|
||||
ActiveModel::Type::Boolean.new.cast(params[:is_mirror])
|
||||
end
|
||||
|
||||
def base64_decode_password
|
||||
Base64.strict_decode64(params[:password] || "")
|
||||
rescue
|
||||
params[:password]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue