Allow system admins to switch user accounts to email/password (#2893)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
d2ddf40f56
Коммит
f2e788f4b1
@@ -462,10 +462,6 @@ func TestAdminResetPassword(t *testing.T) {
|
||||
LinkUserToTeam(user2, team)
|
||||
store.Must(Srv.Store.User().VerifyEmail(user2.Id))
|
||||
|
||||
if _, err := Client.AdminResetPassword(user2.Id, "newpwd"); err == nil {
|
||||
t.Fatal("should have errored - SSO user can't reset password")
|
||||
}
|
||||
|
||||
if _, err := Client.AdminResetPassword(user.Id, "newpwd"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -1702,7 +1702,7 @@ func ResetPassword(c *Context, userId, newPassword string) *model.AppError {
|
||||
user = result.Data.(*model.User)
|
||||
}
|
||||
|
||||
if len(user.AuthData) != 0 {
|
||||
if len(user.AuthData) != 0 && !c.IsSystemAdmin() {
|
||||
return model.NewLocAppError("ResetPassword", "api.user.reset_password.sso.app_error", nil, "userId="+user.Id)
|
||||
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user