diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/user.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/api/user.go b/api/user.go index 695ab2208..9718d534e 100644 --- a/api/user.go +++ b/api/user.go @@ -466,10 +466,14 @@ func RevokeAllSession(c *Context, userId string) { for _, session := range sessions { c.LogAuditWithUserId(userId, "session_id="+session.Id) - sessionCache.Remove(session.Token) - if result := <-Srv.Store.Session().Remove(session.Id); result.Err != nil { - c.Err = result.Err - return + 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 + return + } } } } |