def disable_mfa(request): user = request.user if not is_mfa_enabled(user): return HttpResponseRedirect(reverse("mfa:configure_mfa")) if request.method == "POST": user_mfa = user.userotp user_mfa.delete() return HttpResponseRedirect(reverse("mfa:configure_mfa")) return render(request, 'django_mfa/disable_mfa.html')
def disable_mfa(request): user = request.user if not is_mfa_enabled(user): return HttpResponseRedirect(reverse("mfa:configure_mfa")) if request.method == "POST": user_mfa = user.userotp user_mfa.delete() messages.success(request, "You have successfully disabled multi-factor authentication on your account.") response = redirect(settings.LOGIN_REDIRECT_URL) return delete_rmb_cookie(request, response) return render(request, 'django_mfa/disable_mfa.html')
def disable_mfa(request): user = request.user if not is_mfa_enabled(user): return HttpResponseRedirect(reverse("mfa:configure_mfa")) if request.method == "POST": user_mfa = user.userotp user_mfa.delete() messages.success( request, "You have successfully disabled multi-factor authentication on your account." ) response = redirect(settings.LOGIN_REDIRECT_URL) return delete_rmb_cookie(request, response) return render(request, 'django_mfa/disable_mfa.html')
def security_settings(request): twofactor_enabled = is_mfa_enabled(request.user) return render(request, 'django_mfa/security.html', {"twofactor_enabled": twofactor_enabled})
def security_settings(request): twofactor_enabled = is_mfa_enabled(request.user) return render(request, 'django_mfa/security.html', {"twofactor_enabled": twofactor_enabled})