summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-27 11:36:53 -0400
committerCorey Hulen <corey@hulen.com>2016-05-27 08:36:53 -0700
commitd2aacdbb07c0c0b97c0f45c99cfbbd2f28c56e7b (patch)
treeedf41e49c0d099d852eeda0c38e775e29fb6a144 /api
parent0d0734ac9845ef32c55ebf4c3185ba85065c5940 (diff)
downloadchat-d2aacdbb07c0c0b97c0f45c99cfbbd2f28c56e7b.tar.gz
chat-d2aacdbb07c0c0b97c0f45c99cfbbd2f28c56e7b.tar.bz2
chat-d2aacdbb07c0c0b97c0f45c99cfbbd2f28c56e7b.zip
Don't allow gitlab users to activate mfa (#3125)
Diffstat (limited to 'api')
-rw-r--r--api/user.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/user.go b/api/user.go
index c1b40852d..caf573463 100644
--- a/api/user.go
+++ b/api/user.go
@@ -2336,6 +2336,10 @@ func ActivateMfa(userId, token string) *model.AppError {
user = result.Data.(*model.User)
}
+ if len(user.AuthService) > 0 && user.AuthService != model.USER_AUTH_SERVICE_LDAP {
+ return model.NewLocAppError("ActivateMfa", "api.user.activate_mfa.email_and_ldap_only.app_error", nil, "")
+ }
+
if err := mfaInterface.Activate(user, token); err != nil {
return err
}