diff --git a/pylti1p3/oidc_login.py b/pylti1p3/oidc_login.py index 6d23e01..7a6574f 100644 --- a/pylti1p3/oidc_login.py +++ b/pylti1p3/oidc_login.py @@ -134,7 +134,10 @@ def _prepare_redirect_url(self, launch_url: str) -> str: # LTI message hint to identify LTI context within the platform auth_params["lti_message_hint"] = lti_message_hint - auth_login_return_url = auth_login_url + "?" + urlencode(auth_params) + if "?" in auth_login_url: + auth_login_return_url = auth_login_url + "&" + urlencode(auth_params) + else: + auth_login_return_url = auth_login_url + "?" + urlencode(auth_params) return auth_login_return_url def _prepare_redirect(self, launch_url: str) -> Redirect[RED]: