aboutsummaryrefslogtreecommitdiff
path: root/web.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-06 02:21:44 -0500
committerUnknown <joe2010xtmf@163.com>2014-03-06 02:21:44 -0500
commitc6f2c23b05474d80ea282a7683135b3ea8f8e2d9 (patch)
tree83054b7cb334ffbfbeadc688bf853fa0916696d3 /web.go
parente59f90b8fee3e615d1b60067bfc0d636606899d8 (diff)
Add binding form for register user
Diffstat (limited to 'web.go')
-rw-r--r--web.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/web.go b/web.go
index ca3b4fcf..90551510 100644
--- a/web.go
+++ b/web.go
@@ -14,6 +14,10 @@ import (
"github.com/martini-contrib/render"
"github.com/martini-contrib/sessions"
+ "github.com/gogits/binding"
+
+ "github.com/gogits/gogs/modules/auth"
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/routers"
"github.com/gogits/gogs/routers/repo"
"github.com/gogits/gogs/routers/user"
@@ -46,6 +50,7 @@ func runWeb(*cli.Context) {
// Middleware.
m.Use(render.Renderer(render.Options{Funcs: []template.FuncMap{AppHelpers}}))
+ m.Use(base.InitContext())
// TODO: should use other store because cookie store is not secure.
store := sessions.NewCookieStore([]byte("secret123"))
@@ -55,7 +60,7 @@ func runWeb(*cli.Context) {
m.Get("/", routers.Dashboard)
m.Any("/user/login", user.SignIn)
- m.Any("/user/sign_up", user.SignUp)
+ m.Any("/user/sign_up", binding.BindIgnErr(auth.RegisterForm{}), user.SignUp)
m.Get("/user/profile", user.Profile) // should be /username
m.Any("/user/delete", user.Delete)