Skip to content

Commit

Permalink
Correctly use settings.LOGIN_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Jan 26, 2024
1 parent 7a48bf6 commit cc319cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/simple_openid_connect/integrations/django/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from datetime import datetime, timezone
from typing import Callable

from django.conf import settings
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.shortcuts import resolve_url
from django.urls import reverse

from simple_openid_connect.data import TokenSuccessResponse
Expand Down Expand Up @@ -40,4 +42,4 @@ def __call__(self, request: HttpRequest) -> HttpResponse:
openid_session.save()
return response
else:
return HttpResponseRedirect(reverse("login"))
return HttpResponseRedirect(resolve_url(settings.LOGIN_URL))

0 comments on commit cc319cc

Please sign in to comment.