[Update] 修改mfa

This commit is contained in:
ibuler
2019-11-18 16:30:26 +08:00
parent bfd8a9c66d
commit c9ee8edeaf
14 changed files with 92 additions and 56 deletions

View File

@@ -172,7 +172,7 @@ class UserResetOTPApi(UserQuerysetMixin, generics.RetrieveAPIView):
if user == request.user:
msg = _("Could not reset self otp, use profile reset instead")
return Response({"error": msg}, status=401)
if user.otp_enabled and user.otp_secret_key:
if user.mfa_enabled and user.otp_secret_key:
user.otp_secret_key = ''
user.save()
logout(request)