From d1eafbfeefbaaeb55e40d7621ebd787d919361ef Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 24 Dec 2024 16:00:35 +0530 Subject: [PATCH] Add `GetLoginURLWithparams()` to support `redir_params`. --- connect.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/connect.go b/connect.go index 87f63a5..23cb8c3 100644 --- a/connect.go +++ b/connect.go @@ -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{}