diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-13 16:21:16 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-13 16:21:16 -0400 |
commit | 52de63e7bbd500a90a1a8cb62cdb490b0ba623c7 (patch) | |
tree | 58360a2e5d51285807573d3d58bb90e43bb89041 | |
parent | c01f593daa994dddc208f853c1c116c56d2ea397 (diff) |
Allow 1 letter usernames
-rw-r--r-- | modules/auth/auth.go | 4 | ||||
-rw-r--r-- | public/js/app.js | 1 | ||||
-rw-r--r-- | templates/user/signup.tmpl | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index b0855275..0e871688 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -23,7 +23,7 @@ type Form interface { } type RegisterForm struct { - UserName string `form:"username" binding:"Required;AlphaDash;MinSize(5);MaxSize(30)"` + UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"` RetypePasswd string `form:"retypepasswd"` @@ -59,7 +59,7 @@ func (f *RegisterForm) Validate(errors *binding.Errors, req *http.Request, conte } type LogInForm struct { - UserName string `form:"username" binding:"Required;AlphaDash;MinSize(5);MaxSize(30)"` + UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"` Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"` } diff --git a/public/js/app.js b/public/js/app.js index 69d21020..0f0ecc43 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -78,7 +78,6 @@ function initRegister() { rules: { "username": { required: true, - minlength: 5, maxlength: 30 }, "email": { diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl index ba41b0c9..2f1e82c7 100644 --- a/templates/user/signup.tmpl +++ b/templates/user/signup.tmpl @@ -7,7 +7,7 @@ <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}"> <label class="col-md-4 control-label">Username: </label> <div class="col-md-6"> - <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required" title="Username must contain at least 5 characters"> + <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required"> </div> </div> |