summaryrefslogtreecommitdiffstats
path: root/routers/user/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/setting.go')
-rw-r--r--routers/user/setting.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index bd2c923b70..a2f32e3e19 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -222,7 +222,9 @@ func SettingsSecurityPost(ctx *context.Context, form auth.ChangePasswordForm) {
return
}
- if ctx.User.IsPasswordSet() && !ctx.User.ValidatePassword(form.OldPassword) {
+ if len(form.Password) < setting.MinPasswordLength {
+ ctx.Flash.Error(ctx.Tr("auth.password_too_short", setting.MinPasswordLength))
+ } else if ctx.User.IsPasswordSet() && !ctx.User.ValidatePassword(form.OldPassword) {
ctx.Flash.Error(ctx.Tr("settings.password_incorrect"))
} else if form.Password != form.Retype {
ctx.Flash.Error(ctx.Tr("form.password_not_match"))