Add config.expireInactiveSession to add support for non-expiring inactive sessions (#1536)

* Create non-expiring session when sessionLength is zero

* Introduce expireInactiveSessions setting
This commit is contained in:
Steven Shipton
2016-05-06 20:50:45 +01:00
committed by Drew
parent b00572de65
commit 37c502bed0
4 changed files with 66 additions and 8 deletions

View File

@@ -332,6 +332,29 @@ describe('server', () => {
sessionLength: '0'
})).toThrow('Session length must be a value greater than 0.');
done();
});
it('ignores the session length when expireInactiveSessions set to false', (done) => {
expect(() => setServerConfiguration({
serverURL: 'http://localhost:8378/1',
appId: 'test',
appName: 'unused',
javascriptKey: 'test',
masterKey: 'test',
sessionLength: '-33',
expireInactiveSessions: false
})).not.toThrow();
expect(() => setServerConfiguration({
serverURL: 'http://localhost:8378/1',
appId: 'test',
appName: 'unused',
javascriptKey: 'test',
masterKey: 'test',
sessionLength: '0',
expireInactiveSessions: false
})).not.toThrow();
done();
})
it('fails if you try to set revokeSessionOnPasswordReset to non-boolean', done => {