aboutsummaryrefslogtreecommitdiff
path: root/web.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-03 22:44:51 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-03 22:44:51 +0800
commitb73cf0ee77cf035b118315568c605f4f54fa81aa (patch)
treef533974faf938d48f99106f58c12c46532bf462e /web.go
parentc2dbaebde047b1593edee964121d15255dfba66f (diff)
parentaad4856948eeba50fdaedab34ca6346423aad158 (diff)
merge
Diffstat (limited to 'web.go')
-rw-r--r--web.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/web.go b/web.go
index 77226f57..4fca90a2 100644
--- a/web.go
+++ b/web.go
@@ -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)