1
0
Fork 0
This commit is contained in:
Hugh Rundle 2022-09-11 21:03:23 +10:00
parent 8837495ffd
commit 1d13f0ab4f
3 changed files with 23 additions and 5 deletions

View file

@ -54,7 +54,11 @@ class Login(View):
# if 2fa is set, don't log them in until they enter the right code
if user.two_factor_auth == True:
form = forms.Confirm2FAForm(request.GET, user)
return TemplateResponse(request, "two_factor_auth/two_factor_login.html", {"form": form, "2fa_user": user})
return TemplateResponse(
request,
"two_factor_auth/two_factor_login.html",
{"form": form, "2fa_user": user},
)
# otherwise, successful login
login(request, user)
@ -84,6 +88,7 @@ class Login(View):
data = {"login_form": login_form, "register_form": register_form}
return TemplateResponse(request, "landing/login.html", data)
@method_decorator(login_required, name="dispatch")
class Logout(View):
"""log out"""