1
0
mirror of https://github.com/gogs/gogs.git synced 2025-04-28 13:50:35 +00:00

user/auth: flush and destroy session at logout ()

Reported by @cezar97.
This commit is contained in:
Unknwon 2018-12-04 19:35:44 -05:00
parent be6bb5314e
commit f2ec0d80a8
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
3 changed files with 9 additions and 9 deletions
gogs.go
routes/user
vendor

@ -16,7 +16,7 @@ import (
"github.com/gogs/gogs/pkg/setting"
)
const APP_VER = "0.11.75.1203"
const APP_VER = "0.11.76.1204"
func init() {
setting.AppVer = APP_VER

@ -281,8 +281,8 @@ func LoginTwoFactorRecoveryCodePost(c *context.Context) {
}
func SignOut(c *context.Context) {
c.Session.Delete("uid")
c.Session.Delete("uname")
c.Session.Flush()
c.Session.Destory(c.Context)
c.SetCookie(setting.CookieUserName, "", -1, setting.AppSubURL)
c.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubURL)
c.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubURL)

12
vendor/vendor.json vendored

@ -135,16 +135,16 @@
"revisionTime": "2016-06-27T17:00:12Z"
},
{
"checksumSHA1": "qLY+SEQlwlFlpUwT2ZyUv+UlsxA=",
"checksumSHA1": "/t1kyFHHcqE/fUrjgdw9X8PlrqQ=",
"path": "github.com/go-macaron/session",
"revision": "068d408f9c54c7fa7fcc5e2bdd3241ab21280c9e",
"revisionTime": "2018-11-07T03:18:28Z"
"revision": "cdb0ddf74421e2bbc43443789c46540f5235a71a",
"revisionTime": "2018-12-05T00:27:18Z"
},
{
"checksumSHA1": "jVW5CmzplA0UDjai0AFYJFVXAJk=",
"checksumSHA1": "AGaED15nGifQkpU2bpU9Kgd7O4A=",
"path": "github.com/go-macaron/session/redis",
"revision": "068d408f9c54c7fa7fcc5e2bdd3241ab21280c9e",
"revisionTime": "2018-11-07T03:18:28Z"
"revision": "cdb0ddf74421e2bbc43443789c46540f5235a71a",
"revisionTime": "2018-12-05T00:27:18Z"
},
{
"checksumSHA1": "VMRkwnbl0mKWWvK/62CnIlv1oOg=",