Keep GET parameters on OTP login
This commit is contained in:
parent
5c4325d57d
commit
2c09055821
2 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,8 @@ class LoginView(OnlyLoggedOutMixin, TitleMixin, DjangoLoginView):
|
|||
if has_otp(user := form.get_user()):
|
||||
session = AuthSession.objects.create(user=user)
|
||||
self.request.session["AuthSession"] = str(session.id)
|
||||
return HttpResponseRedirect(reverse_lazy("auth:totplogin"))
|
||||
attrs = ("?" + self.request.GET.urlencode()) if self.request.GET else ""
|
||||
return HttpResponseRedirect(reverse_lazy("auth:totplogin") + attrs)
|
||||
|
||||
self.request.session["LastActivity"] = timezone.now().timestamp()
|
||||
return super().form_valid(form)
|
||||
|
|
|
@ -4,7 +4,7 @@ from django.views.generic import RedirectView
|
|||
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/login/', RedirectView.as_view(url=reverse_lazy("auth:login", query_string=True))),
|
||||
path('admin/login/', RedirectView.as_view(url=reverse_lazy("auth:login"), query_string=True)),
|
||||
path('admin/', admin.site.urls),
|
||||
re_path(r'^openid/', include('oidc_provider.urls', namespace='oidc_provider')),
|
||||
path('auth/', include(("authentication.urls", "auth"))),
|
||||
|
|
Loading…
Reference in a new issue