diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-02-29 00:26:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 00:26:03 +0800 |
commit | d59b0f6ff7ee24d94eaa5ad68173405faea6a81c (patch) | |
tree | aac389356946b2f6b0f5281843d1dde3ed23f121 /internal/cmd/web.go | |
parent | 1898201b8b4e555b6dfabd58c5d1136051f35b93 (diff) |
conf: overhaul sessions settings (#5952)
Diffstat (limited to 'internal/cmd/web.go')
-rw-r--r-- | internal/cmd/web.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/cmd/web.go b/internal/cmd/web.go index 4cf1edac..728d5c80 100644 --- a/internal/cmd/web.go +++ b/internal/cmd/web.go @@ -142,10 +142,18 @@ func newMacaron() *macaron.Macaron { m.Use(captcha.Captchaer(captcha.Options{ SubURL: conf.Server.Subpath, })) - m.Use(session.Sessioner(conf.SessionConfig)) + m.Use(session.Sessioner(session.Options{ + Provider: conf.Session.Provider, + ProviderConfig: conf.Session.ProviderConfig, + CookieName: conf.Session.CookieName, + CookiePath: conf.Server.Subpath, + Gclifetime: conf.Session.GCInterval, + Maxlifetime: conf.Session.MaxLifeTime, + Secure: conf.Session.CookieSecure, + })) m.Use(csrf.Csrfer(csrf.Options{ Secret: conf.Security.SecretKey, - Cookie: conf.CSRFCookieName, + Cookie: conf.Session.CSRFCookieName, SetCookie: true, Header: "X-Csrf-Token", CookiePath: conf.Server.Subpath, |