Skip to content

Commit

Permalink
chore: update base urls to tbank
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Kulkov committed Jul 29, 2024
1 parent ab11f9e commit 054ee6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (f *SeleniumAuthFlow) authorize(ctx context.Context, c *Client, authorizer
return nil, errors.Wrap(err, "maximize window")
}

if err := driver.Get("https://tinkoff.ru/auth/login"); err != nil {
if err := driver.Get(baseURL + "/login"); err != nil {
return nil, errors.Wrap(err, "open login page")
}

Expand Down
7 changes: 4 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
)

const (
baseURL = "https://www.tinkoff.ru/api"
baseURL = "https://www.tbank.ru"
baseApiURL = baseURL + "/api"
pingInterval = time.Minute
)

Expand Down Expand Up @@ -289,7 +290,7 @@ func executeInvest[R any](ctx context.Context, c *Client, in investExchange[R])
urlQuery.Set("sessionId", sessionID)
}

httpReq, err := http.NewRequest(http.MethodGet, baseURL+in.path(), nil)
httpReq, err := http.NewRequest(http.MethodGet, baseApiURL+in.path(), nil)
if err != nil {
return nil, errors.Wrap(err, "create http request")
}
Expand Down Expand Up @@ -403,7 +404,7 @@ func executeCommon[R any](ctx context.Context, c *Client, in commonExchange[R])
return nil, errors.Wrap(err, "encode form values")
}

httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, baseURL+in.path(), strings.NewReader(reqBody.Encode()))
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, baseApiURL+in.path(), strings.NewReader(reqBody.Encode()))
if err != nil {
return nil, errors.Wrap(err, "create request")
}
Expand Down

0 comments on commit 054ee6a

Please sign in to comment.