Initial mfa support (for internal users) #93591

Merged
Oleg-Komarov merged 46 commits from mfa into main 2024-08-29 11:44:06 +02:00
4 changed files with 6 additions and 6 deletions
Showing only changes of commit d51d93d839 - Show all commits

View File

@ -168,12 +168,12 @@ urlpatterns = [
), ),
path( path(
'mfa/totp/', 'mfa/totp/',
mfa.TotpView.as_view(), mfa.TotpRegisterView.as_view(),
name='mfa_totp', name='mfa_totp',
), ),
path( path(
'mfa/u2f/', 'mfa/u2f/',
mfa.U2fView.as_view(), mfa.U2fRegisterView.as_view(),
name='mfa_u2f', name='mfa_u2f',
), ),
path( path(

View File

@ -96,10 +96,10 @@ class InvalidateRecoveryView(mixins.MfaRequiredIfConfiguredMixin, View):
return redirect('bid_main:mfa') return redirect('bid_main:mfa')
Oleg-Komarov marked this conversation as resolved Outdated

same as above

same as above
class TotpView(mixins.MfaRequiredIfConfiguredMixin, FormView): class TotpRegisterView(mixins.MfaRequiredIfConfiguredMixin, FormView):
form_class = TotpRegisterForm form_class = TotpRegisterForm
success_url = reverse_lazy('bid_main:mfa') success_url = reverse_lazy('bid_main:mfa')
template_name = "bid_main/mfa/totp.html" template_name = "bid_main/mfa/totp_register.html"
def get_form_kwargs(self): def get_form_kwargs(self):
kwargs = super().get_form_kwargs() kwargs = super().get_form_kwargs()
@ -134,10 +134,10 @@ class TotpView(mixins.MfaRequiredIfConfiguredMixin, FormView):
return super().form_valid(form) return super().form_valid(form)
class U2fView(mixins.MfaRequiredIfConfiguredMixin, FormView): class U2fRegisterView(mixins.MfaRequiredIfConfiguredMixin, FormView):
form_class = U2fRegisterForm form_class = U2fRegisterForm
success_url = reverse_lazy('bid_main:mfa') success_url = reverse_lazy('bid_main:mfa')
template_name = "bid_main/mfa/u2f.html" template_name = "bid_main/mfa/u2f_register.html"
def get_form_kwargs(self): def get_form_kwargs(self):
Oleg-Komarov marked this conversation as resolved
Review

is context['first_device'] = not devices_for_user(self.request.user) necessary here as well?

is `context['first_device'] = not devices_for_user(self.request.user)` necessary here as well?
credentials = [ credentials = [