From cccf53c2533988c25766c11b62f6fcc251055215 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Wed, 7 Aug 2024 12:39:06 -0500 Subject: [PATCH] Fix/prod redirect uri (#1391) * always use www in prod redirect uri * add www replacement in tapis_oath call --- designsafe/apps/auth/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designsafe/apps/auth/views.py b/designsafe/apps/auth/views.py index 7c6ca04a43..d44f6822e9 100644 --- a/designsafe/apps/auth/views.py +++ b/designsafe/apps/auth/views.py @@ -46,6 +46,10 @@ def tapis_oauth(request): protocol = "http" redirect_uri = f"{protocol}://{request.get_host()}{reverse('designsafe_auth:tapis_oauth_callback')}" + if request.get_host() == "designsafe-ci.org": + redirect_uri = redirect_uri.replace( + "designsafe-ci.org", "www.designsafe-ci.org" + ) tenant_base_url = getattr(settings, "TAPIS_TENANT_BASEURL") client_id = getattr(settings, "TAPIS_CLIENT_ID")