Add the trim as well for the user creation
This commit is contained in:
parent
f6cf82fcb3
commit
645c4ce217
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
package trantor
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
log "github.com/cihub/seelog"
|
||||
"gitlab.com/trantor/trantor/lib/database"
|
||||
|
||||
|
@ -42,7 +44,7 @@ func createUserHandler(h handler) {
|
|||
} else if pass == "" {
|
||||
h.sess.Notify("Registration error!", "The password can't be empty", "error")
|
||||
} else {
|
||||
user := h.r.FormValue("user")
|
||||
user := strings.TrimSpace(h.r.FormValue("user"))
|
||||
err := h.db.AddUser(user, pass)
|
||||
if err == nil {
|
||||
h.sess.Notify("Account created!", "Welcome "+user+". Now you can login", "success")
|
||||
|
|
Reference in a new issue