MM-29607 allow user to deactivate MFA even when disabled (#16994)

Automatic Merge
Этот коммит содержится в:
Max Erenberg
2021-03-22 14:32:19 -04:00
коммит произвёл GitHub
родитель 6a77e24adc
Коммит 0aa6499a48
2 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@@ -781,10 +781,6 @@ func (a *App) ActivateMfa(userID, token string) *model.AppError {
}
func (a *App) DeactivateMfa(userID string) *model.AppError {
if !*a.Config().ServiceSettings.EnableMultifactorAuthentication {
return model.NewAppError("DeactivateMfa", "mfa.mfa_disabled.app_error", nil, "", http.StatusNotImplemented)
}
if err := mfa.New(a.Srv().Store.User()).Deactivate(userID); err != nil {
return model.NewAppError("DeactivateMfa", "mfa.deactivate.app_error", nil, err.Error(), http.StatusInternalServerError)
}