summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-28 09:49:54 -0300
committerChristopher Speller <crspeller@gmail.com>2016-09-28 08:49:54 -0400
commitcaeadde2f24384deca67f9d00999252ee53570ad (patch)
tree717b20d9034ff12ffab301c0defc2b0b7bb046e4
parent45ca052482d42a535f399b149c7e26e99663ac15 (diff)
downloadchat-caeadde2f24384deca67f9d00999252ee53570ad.tar.gz
chat-caeadde2f24384deca67f9d00999252ee53570ad.tar.bz2
chat-caeadde2f24384deca67f9d00999252ee53570ad.zip
PLT-4155 Show correct login method in system console (#4102)
* PLT-4155 Show correct login method in system console * Remove checking for system admin privileges in getProfiles
-rw-r--r--api/user.go1
-rw-r--r--model/user.go4
2 files changed, 4 insertions, 1 deletions
diff --git a/api/user.go b/api/user.go
index 5b2024315..ae8136d7a 100644
--- a/api/user.go
+++ b/api/user.go
@@ -2518,6 +2518,7 @@ func sanitizeProfile(c *Context, user *model.User) *model.User {
if HasPermissionToContext(c, model.PERMISSION_MANAGE_SYSTEM) {
options["email"] = true
options["fullname"] = true
+ options["authservice"] = true
}
c.Err = nil
diff --git a/model/user.go b/model/user.go
index b7ac85baa..1b51171ad 100644
--- a/model/user.go
+++ b/model/user.go
@@ -232,13 +232,15 @@ func (u *User) Sanitize(options map[string]bool) {
if len(options) != 0 && !options["passwordupdate"] {
u.LastPasswordUpdate = 0
}
+ if len(options) != 0 && !options["authservice"] {
+ u.AuthService = ""
+ }
}
func (u *User) ClearNonProfileFields() {
u.Password = ""
u.AuthData = new(string)
*u.AuthData = ""
- u.AuthService = ""
u.MfaActive = false
u.MfaSecret = ""
u.EmailVerified = false