1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-22 07:12:22 +02:00

regru: update authentication method (#2325)

This commit is contained in:
Maksim Kamanin 2024-11-08 13:56:24 +03:00 committed by GitHub
parent 815c61ac07
commit f8db554820
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,17 +76,14 @@ func (c Client) AddTXTRecord(ctx context.Context, domain, subDomain, content str
func (c Client) doRequest(ctx context.Context, request any, fragments ...string) (*APIResponse, error) {
endpoint := c.baseURL.JoinPath(fragments...)
query := endpoint.Query()
query.Set("username", c.username)
query.Set("password", c.password)
endpoint.RawQuery = query.Encode()
inputData, err := json.Marshal(request)
if err != nil {
return nil, fmt.Errorf("failed to create input data: %w", err)
}
data := url.Values{}
data.Set("username", c.username)
data.Set("password", c.password)
data.Set("input_data", string(inputData))
data.Set("input_format", "json")