From c6f2c23b05474d80ea282a7683135b3ea8f8e2d9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 6 Mar 2014 02:21:44 -0500 Subject: Add binding form for register user --- web.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web.go') 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) -- cgit v1.2.3