mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-05 01:44:36 -04:00
update session
This commit is contained in:
parent
0d1872ebe3
commit
f9c07c4186
7 changed files with 79 additions and 21 deletions
5
web.go
5
web.go
|
@ -12,7 +12,6 @@ import (
|
|||
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/codegangsta/martini"
|
||||
"github.com/martini-contrib/sessions"
|
||||
|
||||
"github.com/gogits/binding"
|
||||
|
||||
|
@ -81,10 +80,6 @@ func runWeb(*cli.Context) {
|
|||
// Middlewares.
|
||||
m.Use(middleware.Renderer(middleware.RenderOptions{Funcs: []template.FuncMap{base.TemplateFuncs}}))
|
||||
|
||||
// TODO: should use other store because cookie store is not secure.
|
||||
store := sessions.NewCookieStore([]byte("secret123"))
|
||||
m.Use(sessions.Sessions("my_session", store))
|
||||
|
||||
m.Use(middleware.InitContext())
|
||||
|
||||
reqSignIn := middleware.SignInRequire(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue