Fix Zerodha callback state propagation
This commit is contained in:
parent
988443f40f
commit
b5b759c5ed
@ -33,7 +33,9 @@ def build_login_url(api_key: str, redirect_url: str | None = None, state: str |
|
|||||||
if redirect_url:
|
if redirect_url:
|
||||||
params["redirect_url"] = redirect_url
|
params["redirect_url"] = redirect_url
|
||||||
if state:
|
if state:
|
||||||
params["state"] = state
|
# Kite Connect echoes redirect_params back to the redirect URL.
|
||||||
|
# Using a raw "state" query parameter here is not reliable.
|
||||||
|
params["redirect_params"] = urllib.parse.urlencode({"state": state})
|
||||||
query = urllib.parse.urlencode(params)
|
query = urllib.parse.urlencode(params)
|
||||||
return f"{KITE_LOGIN_URL}?{query}"
|
return f"{KITE_LOGIN_URL}?{query}"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user