diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-03 22:44:51 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-03 22:44:51 +0800 |
commit | b73cf0ee77cf035b118315568c605f4f54fa81aa (patch) | |
tree | f533974faf938d48f99106f58c12c46532bf462e /web.go | |
parent | c2dbaebde047b1593edee964121d15255dfba66f (diff) | |
parent | aad4856948eeba50fdaedab34ca6346423aad158 (diff) |
merge
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -12,6 +12,7 @@ import ( "github.com/codegangsta/cli" "github.com/codegangsta/martini" "github.com/martini-contrib/render" + "github.com/martini-contrib/sessions" "github.com/gogits/gogs/routers" "github.com/gogits/gogs/routers/repo" @@ -46,6 +47,10 @@ func runWeb(*cli.Context) { // Middleware. m.Use(render.Renderer(render.Options{Funcs: []template.FuncMap{AppHelpers}})) + // TODO: should use other store because cookie store is not secure. + store := sessions.NewCookieStore([]byte("secret123")) + m.Use(sessions.Sessions("my_session", store)) + // Routers. m.Get("/", routers.Dashboard) m.Any("/login", user.SignIn) |