Commit 2e97d39a by bergquist

removes commented code

parent 47a7d93f
......@@ -46,9 +46,8 @@ func (s *UserAuthTokenService) UserAuthenticatedHook(user *models.User, c *model
Name: sessionCookieKey,
Value: url.QueryEscape(userToken.UnhashedToken),
HttpOnly: true,
//MaxAge: 600,
Domain: setting.Domain,
Path: setting.AppSubUrl + "/",
Domain: setting.Domain,
Path: setting.AppSubUrl + "/",
}
c.Resp.Header().Add("Set-Cookie", cookie.String())
......@@ -57,7 +56,6 @@ func (s *UserAuthTokenService) UserAuthenticatedHook(user *models.User, c *model
}
func (s *UserAuthTokenService) UserSignedOutHook(c *models.ReqContext) {
//c.SetCookie(sessionCookieKey, "", -1, setting.AppSubUrl+"/", setting.Domain, false, true)
c.Resp.Header().Del("Set-Cookie")
cookie := http.Cookie{
Name: sessionCookieKey,
......@@ -71,28 +69,6 @@ func (s *UserAuthTokenService) UserSignedOutHook(c *models.ReqContext) {
c.Resp.Header().Add("Set-Cookie", cookie.String())
}
// func (s *UserAuthTokenService) RequestMiddleware() macaron.Handler {
// return func(ctx *models.ReqContext) {
// authToken := ctx.GetCookie(sessionCookieKey)
// userToken, err := s.LookupToken(authToken)
// if err != nil {
// }
// ctx.Next()
// refreshed, err := s.RefreshToken(userToken, ctx.RemoteAddr(), ctx.Req.UserAgent())
// if err != nil {
// }
// if refreshed {
// ctx.Resp.Header().Del("Set-Cookie")
// ctx.SetCookie(sessionCookieKey, userToken.unhashedToken, setting.AppSubUrl+"/", setting.Domain, false, true)
// }
// }
// }
func (s *UserAuthTokenService) CreateToken(userId int64, clientIP, userAgent string) (*models.UserAuthToken, error) {
clientIP = util.ParseIPAddress(clientIP)
token, err := util.RandomHex(16)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment