From 215ad92c5c31e7d7797d1ac01cfdb19ecf49ad8c Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Wed, 10 Jul 2024 15:11:00 +0300 Subject: [PATCH] Update redirect to cognito to a relative url --- backend/civil_society_vote/urls.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/civil_society_vote/urls.py b/backend/civil_society_vote/urls.py index 8c44bc96..7b4e4ea0 100644 --- a/backend/civil_society_vote/urls.py +++ b/backend/civil_society_vote/urls.py @@ -3,7 +3,7 @@ from django.conf.urls.static import static from django.contrib import admin from django.contrib.auth import views as auth_views -from django.urls import include, path +from django.urls import include, path, reverse from django.utils.translation import gettext_lazy as _ from django.views.generic.base import RedirectView @@ -77,9 +77,11 @@ ) urlpatterns_simple = [ + # Skip the login provider selector page and redirect to Cognito path( - "allauth/login/", RedirectView.as_view(url="/allauth/amazon-cognito/login/", permanent=True) - ), # Skip the provider selector page and redirect to Cognito + "allauth/login/", + RedirectView.as_view(url=reverse("amazon_cognito_login", urlconf="allauth.urls"), permanent=True), + ), path("allauth/", include("allauth.urls")), ]