MM-29607 allow user to deactivate MFA even when disabled (#16994)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6a77e24adc
Коммит
0aa6499a48
@@ -1440,3 +1440,18 @@ func TestUpdateUserRolesWithUser(t *testing.T) {
|
||||
_, err = th.App.UpdateUserRolesWithUser(user, "does not exist", false)
|
||||
require.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestDeactivateMfa(t *testing.T) {
|
||||
t.Run("MFA is disabled", func(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ServiceSettings.EnableMultifactorAuthentication = false
|
||||
})
|
||||
|
||||
user := th.BasicUser
|
||||
err := th.App.DeactivateMfa(user.Id)
|
||||
require.Nil(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user