mirror of
https://github.com/go-acme/lego.git
synced 2025-01-03 07:19:39 +02:00
regru: update authentication method (#2325)
This commit is contained in:
parent
815c61ac07
commit
f8db554820
@ -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) {
|
func (c Client) doRequest(ctx context.Context, request any, fragments ...string) (*APIResponse, error) {
|
||||||
endpoint := c.baseURL.JoinPath(fragments...)
|
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)
|
inputData, err := json.Marshal(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create input data: %w", err)
|
return nil, fmt.Errorf("failed to create input data: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
data := url.Values{}
|
data := url.Values{}
|
||||||
|
data.Set("username", c.username)
|
||||||
|
data.Set("password", c.password)
|
||||||
data.Set("input_data", string(inputData))
|
data.Set("input_data", string(inputData))
|
||||||
data.Set("input_format", "json")
|
data.Set("input_format", "json")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user