MM-12976: Moving MFA to Team edition (#9971)
* MM-12976: Moving MFA to Team edition * Changing the mfa disabled i18n key and string
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f94567c97b
Коммит
a7b6c71421
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/services/mfa"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
)
|
||||
|
||||
@@ -145,15 +146,12 @@ func (a *App) CheckUserPostflightAuthenticationCriteria(user *model.User) *model
|
||||
}
|
||||
|
||||
func (a *App) CheckUserMfa(user *model.User, token string) *model.AppError {
|
||||
if license := a.License(); !user.MfaActive || license == nil || !*license.Features.MFA || !*a.Config().ServiceSettings.EnableMultifactorAuthentication {
|
||||
if !user.MfaActive || !*a.Config().ServiceSettings.EnableMultifactorAuthentication {
|
||||
return nil
|
||||
}
|
||||
|
||||
if a.Mfa == nil {
|
||||
return model.NewAppError("checkUserMfa", "api.user.check_user_mfa.not_available.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
ok, err := a.Mfa.ValidateToken(user.MfaSecret, token)
|
||||
mfaService := mfa.New(a, a.Srv.Store)
|
||||
ok, err := mfaService.ValidateToken(user.MfaSecret, token)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user