[MM-32044] Reset SAML auth data (#17161)

Automatic Merge
Этот коммит содержится в:
Max Erenberg
2021-04-12 18:46:30 -04:00
коммит произвёл GitHub
родитель 2de65cfb11
Коммит 869da7a78b
16 изменённых файлов: 292 добавлений и 3 удалений

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

@@ -282,3 +282,16 @@ func (a *App) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError {
return nil
}
func (a *App) ResetSamlAuthDataToEmail(includeDeleted bool, dryRun bool, userIDs []string) (numAffected int, appErr *model.AppError) {
if a.Saml() == nil {
appErr = model.NewAppError("ResetAuthDataToEmail", "api.admin.saml.not_available.app_error", nil, "", http.StatusNotImplemented)
return
}
numAffected, err := a.srv.Store.User().ResetAuthDataToEmailForUsers(model.USER_AUTH_SERVICE_SAML, userIDs, includeDeleted, dryRun)
if err != nil {
appErr = model.NewAppError("ResetAuthDataToEmail", "api.admin.saml.failure_reset_authdata_to_email.app_error", nil, err.Error(), http.StatusInternalServerError)
return
}
return
}