Skip to content

Commit 8164b31

Browse files
authored
Merge pull request #109 from zerodha/redir-params
Add `GetLoginURLWithparams()` to support `redir_params`.
2 parents 5b581b7 + d1eafbf commit 8164b31

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

connect.go

+6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ func (c *Client) GetLoginURL() string {
196196
return fmt.Sprintf("%s/connect/login?api_key=%s&v=%s", kiteBaseURI, c.apiKey, kiteHeaderVersion)
197197
}
198198

199+
// GetLoginURL gets Kite Connect login endpoint with redirect params appended.
200+
func (c *Client) GetLoginURLWithparams(p url.Values) string {
201+
return fmt.Sprintf("%s/connect/login?api_key=%s&v=%s&redirect_params=%s",
202+
kiteBaseURI, c.apiKey, kiteHeaderVersion, url.QueryEscape(p.Encode()))
203+
}
204+
199205
func (c *Client) doEnvelope(method, uri string, params url.Values, headers http.Header, v interface{}) error {
200206
if params == nil {
201207
params = url.Values{}

0 commit comments

Comments
 (0)