summaryrefslogtreecommitdiffstats
path: root/api/authentication.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-07-12 10:52:43 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-07-12 10:52:43 -0400
commit954e251188621563b3b10218f4072cc358149e84 (patch)
tree0fa41b4ecc7dcd5e9e73062ad6ebc7edd5343da0 /api/authentication.go
parentad343a0f4ad175053f7d0da12a0587bcbb396d1c (diff)
parentc377605906fc7eeb9dcaf75e66732efd3b4fe7fc (diff)
downloadchat-954e251188621563b3b10218f4072cc358149e84.tar.gz
chat-954e251188621563b3b10218f4072cc358149e84.tar.bz2
chat-954e251188621563b3b10218f4072cc358149e84.zip
Merged release-3.2 into master
Diffstat (limited to 'api/authentication.go')
-rw-r--r--api/authentication.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/api/authentication.go b/api/authentication.go
index 8170f0a8e..fbfdb2cf4 100644
--- a/api/authentication.go
+++ b/api/authentication.go
@@ -13,11 +13,24 @@ import (
)
func checkPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError {
+ if err := checkUserAdditionalAuthenticationCriteria(user, mfaToken); err != nil {
+ return err
+ }
+
if err := checkUserPassword(user, password); err != nil {
return err
}
- if err := checkUserAdditionalAuthenticationCriteria(user, mfaToken); err != nil {
+ return nil
+}
+
+// This to be used for places we check the users password when they are already logged in
+func doubleCheckPassword(user *model.User, password string) *model.AppError {
+ if err := checkUserLoginAttempts(user); err != nil {
+ return err
+ }
+
+ if err := checkUserPassword(user, password); err != nil {
return err
}