Merge pull request #20756 from overleaf/jpa-clear-admin-sessions

[web] add script for clearing admin sessions

GitOrigin-RevId: c5103b233073db62276698067b2262d7a785592b
This commit is contained in:
Jakob Ackermann
2024-10-14 10:58:12 +00:00
committed by Copybot
parent 85bc305df2
commit 39ee8de1a5
3 changed files with 87 additions and 5 deletions
@@ -363,6 +363,14 @@ describe('UserSessionsManager', function () {
})
})
it('should yield the number of purged sessions', function (done) {
return this.call((err, n) => {
expect(err).to.not.exist
expect(n).to.equal(this.sessionKeys.length)
return done()
})
})
it('should call the appropriate redis methods', function (done) {
return this.call(err => {
this.rclient.smembers.callCount.should.equal(1)
@@ -465,9 +473,11 @@ describe('UserSessionsManager', function () {
})
})
it('should not produce an error', function (done) {
it('should produce an error', function (done) {
return this.call(err => {
expect(err).to.not.exist
expect(err).to.match(
/bug: user not passed to removeSessionsFromRedis/
)
return done()
})
})