SachinyadavAug20 commented on code in PR #77209:
URL: https://github.com/apache/airflow/pull/77209#discussion_r4617201534
##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/routes/login.py:
##########
@@ -273,14 +286,17 @@ def login_callback(request: Request):
username=saml_auth.get_nameid(),
email=attributes["email"][0] if "email" in attributes else None,
)
- url = conf.get("api", "base_url", fallback="/")
+ fallback_url = conf.get("api", "base_url", fallback="/")
+ next_url = matched.get("next") if matched else None
+ redirect_url = next_url if next_url and is_safe_url(next_url,
request=request) else fallback_url
Review Comment:
Good point, since it’s already validated in _start_login and HMAC-signed in
the cookie, re-checking it here is redundant.
Removed!
##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/routes/login.py:
##########
@@ -273,14 +286,17 @@ def login_callback(request: Request):
username=saml_auth.get_nameid(),
email=attributes["email"][0] if "email" in attributes else None,
)
- url = conf.get("api", "base_url", fallback="/")
+ fallback_url = conf.get("api", "base_url", fallback="/")
+ next_url = matched.get("next") if matched else None
+ redirect_url = next_url if next_url and is_safe_url(next_url,
request=request) else fallback_url
token = get_auth_manager().generate_jwt(user)
+ cookie_path = get_cookie_path()
+ secure = _is_secure_request(request)
Review Comment:
Moved them back inside if mode == LOGIN_MODE_REDIRECT:.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]