summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-12-08 07:18:15 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-12-08 10:18:15 -0500
commitc4974374d9840caa6ec496c138a6220dd40afa54 (patch)
treec450cb63b76e032412f3e9c4433bae9518c89513 /api/user.go
parent7acd135e021de28bac61e65d5293be8a4f0df328 (diff)
downloadchat-c4974374d9840caa6ec496c138a6220dd40afa54.tar.gz
chat-c4974374d9840caa6ec496c138a6220dd40afa54.tar.bz2
chat-c4974374d9840caa6ec496c138a6220dd40afa54.zip
PLT-4853 Adding cache purging to the server (server) (#4735)
* PLT-4853 Adding caching invalidation to HA * PLT-4853 Adding cach purging to the server
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/api/user.go b/api/user.go
index 5c92cf47a..2085ccb60 100644
--- a/api/user.go
+++ b/api/user.go
@@ -715,7 +715,7 @@ func attachDeviceId(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
- sessionCache.Remove(c.Session.Token)
+ RemoveAllSessionsForUserId(c.Session.UserId)
c.Session.SetExpireInDays(*utils.Cfg.ServiceSettings.SessionLengthMobileInDays)
maxAge := *utils.Cfg.ServiceSettings.SessionLengthMobileInDays * 60 * 60 * 24
@@ -756,18 +756,13 @@ func RevokeSessionById(c *Context, sessionId string) {
if session.IsOAuth {
RevokeAccessToken(session.Token)
} else {
- sessionCache.Remove(session.Token)
-
if result := <-Srv.Store.Session().Remove(session.Id); result.Err != nil {
c.Err = result.Err
}
}
RevokeWebrtcToken(session.Id)
-
- if einterfaces.GetClusterInterface() != nil {
- einterfaces.GetClusterInterface().RemoveAllSessionsForUserId(session.UserId)
- }
+ RemoveAllSessionsForUserId(session.UserId)
}
}