summaryrefslogtreecommitdiffstats
path: root/api4/user.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-10 09:46:09 -0700
committerGitHub <noreply@github.com>2018-05-10 09:46:09 -0700
commitd8dd271e43550ab043c2db36c274092d7819fcab (patch)
treee297c0534a9684d57fc254281cf5cbc3d7c08e0f /api4/user.go
parentdb6b8f6238853c6e7e48dc8015a0b25f97ee232a (diff)
downloadchat-d8dd271e43550ab043c2db36c274092d7819fcab.tar.gz
chat-d8dd271e43550ab043c2db36c274092d7819fcab.tar.bz2
chat-d8dd271e43550ab043c2db36c274092d7819fcab.zip
MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID without losing their account (#8756)
* Adding LoginIdAttribute * Modifying LDAP to use loginIDAttribute. * Adding IDAttribute migration and AD objectGUID support. * Removing unused idea. * Fix typo.
Diffstat (limited to 'api4/user.go')
-rw-r--r--api4/user.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/api4/user.go b/api4/user.go
index 897c49ad1..2a539a551 100644
--- a/api4/user.go
+++ b/api4/user.go
@@ -771,7 +771,7 @@ func checkUserMfa(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if user, err := c.App.GetUserForLogin(loginId, false); err == nil {
+ if user, err := c.App.GetUserForLogin("", loginId); err == nil {
resp["mfa_required"] = user.MfaActive
}
@@ -943,7 +943,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
ldapOnly := props["ldap_only"] == "true"
c.LogAuditWithUserId(id, "attempt - login_id="+loginId)
- user, err := c.App.AuthenticateUserForLogin(id, loginId, password, mfaToken, deviceId, ldapOnly)
+ user, err := c.App.AuthenticateUserForLogin(id, loginId, password, mfaToken, ldapOnly)
if err != nil {
c.LogAuditWithUserId(id, "failure - login_id="+loginId)
c.Err = err
@@ -1167,7 +1167,7 @@ func sendVerificationEmail(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- user, err := c.App.GetUserForLogin(email, false)
+ user, err := c.App.GetUserForLogin("", email)
if err != nil {
// Don't want to leak whether the email is valid or not
ReturnStatusOK(w)
@@ -1205,7 +1205,7 @@ func switchAccountType(c *Context, w http.ResponseWriter, r *http.Request) {
link, err = c.App.SwitchOAuthToEmail(switchRequest.Email, switchRequest.NewPassword, c.Session.UserId)
} else if switchRequest.EmailToLdap() {
- link, err = c.App.SwitchEmailToLdap(switchRequest.Email, switchRequest.Password, switchRequest.MfaCode, switchRequest.LdapId, switchRequest.NewPassword)
+ link, err = c.App.SwitchEmailToLdap(switchRequest.Email, switchRequest.Password, switchRequest.MfaCode, switchRequest.LdapLoginId, switchRequest.NewPassword)
} else if switchRequest.LdapToEmail() {
link, err = c.App.SwitchLdapToEmail(switchRequest.Password, switchRequest.MfaCode, switchRequest.Email, switchRequest.NewPassword)
} else {