diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-07-12 10:09:04 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-07-12 10:09:04 -0400 |
commit | c976c2881ce5e34febac8a9850a6bad5d728625e (patch) | |
tree | 7fea777c1c9ba386d97dbdaa2e0b8c83cc419056 /api/authentication.go | |
parent | 128e4f984ad565297ab1c7b8921d877d3a9c8f03 (diff) | |
download | chat-c976c2881ce5e34febac8a9850a6bad5d728625e.tar.gz chat-c976c2881ce5e34febac8a9850a6bad5d728625e.tar.bz2 chat-c976c2881ce5e34febac8a9850a6bad5d728625e.zip |
Some improvments to password handling (#3549)
Diffstat (limited to 'api/authentication.go')
-rw-r--r-- | api/authentication.go | 15 |
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 } |