mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-02 14:12:32 +00:00
expire cookie key from setting file length
This commit is contained in:
parent
ed4fdd48d7
commit
b8510301b6
2 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ module.exports = ClsiCookieManager =
|
||||||
serverId = ClsiCookieManager._parseServerIdFromResponse(response)
|
serverId = ClsiCookieManager._parseServerIdFromResponse(response)
|
||||||
multi = rclient.multi()
|
multi = rclient.multi()
|
||||||
multi.set buildKey(project_id), serverId
|
multi.set buildKey(project_id), serverId
|
||||||
multi.expire buildKey(project_id), Settings.clsi_cookie_expire_length
|
multi.expire buildKey(project_id), Settings.clsi_cookie_expire_length_seconds
|
||||||
multi.exec (err)->
|
multi.exec (err)->
|
||||||
callback(err, serverId)
|
callback(err, serverId)
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe "ClsiCookieManager", ->
|
||||||
apis:
|
apis:
|
||||||
clsi:
|
clsi:
|
||||||
url: "http://clsi.example.com"
|
url: "http://clsi.example.com"
|
||||||
clsi_cookie_expire_length: Math.random()
|
clsi_cookie_expire_length_seconds: Math.random()
|
||||||
clsiCookieKey: "coooookie"
|
clsiCookieKey: "coooookie"
|
||||||
@requires =
|
@requires =
|
||||||
"redis-sharelatex" :
|
"redis-sharelatex" :
|
||||||
|
@ -90,7 +90,7 @@ describe "ClsiCookieManager", ->
|
||||||
it "should set the server id with a ttl", (done)->
|
it "should set the server id with a ttl", (done)->
|
||||||
@ClsiCookieManager.setServerId @project_id, @response, (err)=>
|
@ClsiCookieManager.setServerId @project_id, @response, (err)=>
|
||||||
@redisMulti.set.calledWith("clsiserver:#{@project_id}", "clsi-8").should.equal true
|
@redisMulti.set.calledWith("clsiserver:#{@project_id}", "clsi-8").should.equal true
|
||||||
@redisMulti.expire.calledWith("clsiserver:#{@project_id}", @settings.clsi_cookie_expire_length).should.equal true
|
@redisMulti.expire.calledWith("clsiserver:#{@project_id}", @settings.clsi_cookie_expire_length_seconds).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it "should return the server id", (done)->
|
it "should return the server id", (done)->
|
||||||
|
|
Loading…
Reference in a new issue