Sfoglia il codice sorgente

feat(go): allow resetting mfa;

Vishal Dalwadi 4 mesi fa
parent
commit
667680886c
1 ha cambiato i file con 0 aggiunte e 14 eliminazioni
  1. 0 14
      controllers/user.go

+ 0 - 14
controllers/user.go

@@ -452,13 +452,6 @@ func initiateTOTPSetup(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	if user.IsMFAEnabled {
-		err = fmt.Errorf("mfa is already enabled for user, cannot process totp setup")
-		logger.Log(0, err.Error())
-		logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
-		return
-	}
-
 	if user.AuthType == models.OAuth {
 		err = fmt.Errorf("auth type is %s, cannot process totp setup", user.AuthType)
 		logger.Log(0, err.Error())
@@ -538,13 +531,6 @@ func completeTOTPSetup(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	if user.IsMFAEnabled {
-		err = fmt.Errorf("mfa is already enabled for user, cannot process totp setup")
-		logger.Log(0, err.Error())
-		logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
-		return
-	}
-
 	if user.AuthType == models.OAuth {
 		err = fmt.Errorf("auth type is %s, cannot process totp setup", user.AuthType)
 		logger.Log(0, err.Error())