From ce096282917124d5abd61bc44e9d447d0fae4800 Mon Sep 17 00:00:00 2001 From: Teemu Kataja Date: Thu, 31 Oct 2024 10:53:04 +0200 Subject: [PATCH] omit resource key from params if it is empty (#12) --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 19d5ea1..6154616 100644 --- a/main.py +++ b/main.py @@ -134,8 +134,8 @@ async def login_endpoint(): "scope": CONFIG["SCOPE"], } # optional param for special cases - if "RESOURCE" in CONFIG: - params["resource"] = CONFIG["RESOURCE"] + if resource := CONFIG.get("RESOURCE", ""): + params["resource"] = resource # prepare the redirection response url = CONFIG["url_auth"] + "?" + urlencode(params)