kumidc/authentication/views/otp.py

15 lines
490 B
Python
Raw Normal View History

2022-08-04 11:15:10 +00:00
from django.contrib.auth.views import LoginView
from django.utils import timezone
from ..forms.otp import TOTPLoginForm
from ..mixins.session import AuthSessionRequiredMixin
from frontend.mixins.views import TitleMixin
class TOTPLoginView(TitleMixin, AuthSessionRequiredMixin, LoginView):
form_class = TOTPLoginForm
title = "Verify"
def form_valid(self, form):
self.request.session["LastActivity"] = timezone.now().timestamp()
return super().form_valid(form)