From 7ab74eb05218b8912dcd78153f41230365191654 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 7 Nov 2019 16:22:01 +0100 Subject: [PATCH] keep login speed --- models/login_source.go | 5 +---- models/user.go | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/models/login_source.go b/models/login_source.go index 54ddd6826988b..bced2bcee3f0c 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -417,10 +417,7 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR if len(source.LDAP().AdminFilter) > 0 { user.IsAdmin = sr.IsAdmin } - if err := UpdateUserCols(user, "full_name", "email", "is_admin"); err != nil { - return nil, err - } - + go UpdateLdapUserAtLogin(user) } if !autoRegister { diff --git a/models/user.go b/models/user.go index 7aa1e143e835b..fddd3109ced1a 100644 --- a/models/user.go +++ b/models/user.go @@ -1827,3 +1827,10 @@ func SyncExternalUsers() { } } } + +func UpdateLdapUserAtLogin(user *User) (err error) { + if err := UpdateUserCols(user, "full_name", "email", "is_admin"); err != nil { + return err + } + return nil +}