Skip to content

Commit

Permalink
Merge pull request #109 from zerodha/redir-params
Browse files Browse the repository at this point in the history
Add `GetLoginURLWithparams()` to support `redir_params`.
  • Loading branch information
ranjanrak authored Dec 27, 2024
2 parents 5b581b7 + d1eafbf commit 8164b31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ func (c *Client) GetLoginURL() string {
return fmt.Sprintf("%s/connect/login?api_key=%s&v=%s", kiteBaseURI, c.apiKey, kiteHeaderVersion)
}

// GetLoginURL gets Kite Connect login endpoint with redirect params appended.
func (c *Client) GetLoginURLWithparams(p url.Values) string {
return fmt.Sprintf("%s/connect/login?api_key=%s&v=%s&redirect_params=%s",
kiteBaseURI, c.apiKey, kiteHeaderVersion, url.QueryEscape(p.Encode()))
}

func (c *Client) doEnvelope(method, uri string, params url.Values, headers http.Header, v interface{}) error {
if params == nil {
params = url.Values{}
Expand Down

0 comments on commit 8164b31

Please sign in to comment.