mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
api4/user: fix-failing-ee-tests (#15372)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0da164f70e
commit
26cdbd5dba
20
api4/user.go
20
api4/user.go
@@ -2594,6 +2594,16 @@ func migrateAuthToLDAP(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if c.App.Srv().License() == nil || !*c.App.Srv().License().Features.LDAP {
|
||||
c.Err = model.NewAppError("api.migrateAuthToLDAP", "api.admin.ldap.not_available.app_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
// Email auth in Mattermost system is represented by ""
|
||||
if from == "email" {
|
||||
from = ""
|
||||
}
|
||||
|
||||
if migrate := c.App.AccountMigration(); migrate != nil {
|
||||
if err := migrate.MigrateToLdap(from, matchField, force, false); err != nil {
|
||||
c.Err = model.NewAppError("api.migrateAuthToLdap", "api.migrate_to_saml.error", nil, err.Error(), http.StatusInternalServerError)
|
||||
@@ -2643,6 +2653,16 @@ func migrateAuthToSaml(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if c.App.Srv().License() == nil || !*c.App.Srv().License().Features.SAML {
|
||||
c.Err = model.NewAppError("api.migrateAuthToSaml", "api.admin.saml.not_available.app_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
// Email auth in Mattermost system is represented by ""
|
||||
if from == "email" {
|
||||
from = ""
|
||||
}
|
||||
|
||||
if migrate := c.App.AccountMigration(); migrate != nil {
|
||||
if err := migrate.MigrateToSaml(from, usersMap, auto, false); err != nil {
|
||||
c.Err = model.NewAppError("api.migrateAuthToSaml", "api.migrate_to_saml.error", nil, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user