Skip to content

Commit dea1334

Browse files
committed
renew sessions
1 parent a31b30b commit dea1334

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

spec/Auth.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ describe('Auth', () => {
9494
});
9595
});
9696

97-
it('can use renewSessions', async () => {
97+
it('can use extendSessionOnUse', async () => {
9898
await reconfigureServer({
99-
renewSessions: true,
99+
extendSessionOnUse: true,
100100
});
101101

102102
const user = new Parse.User();

spec/index.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ describe('server', () => {
367367
});
368368
});
369369

370-
it('should throw when renewSessions is invalid', async () => {
370+
it('should throw when extendSessionOnUse is invalid', async () => {
371371
await expectAsync(
372372
reconfigureServer({
373-
renewSessions: 'yolo',
373+
extendSessionOnUse: 'yolo',
374374
})
375-
).toBeRejectedWith('renewSessions must be a boolean value');
375+
).toBeRejectedWith('extendSessionOnUse must be a boolean value');
376376
});
377377

378378
it('should throw when revokeSessionOnPasswordReset is invalid', async () => {

src/Auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function nobody(config) {
6868

6969
const throttle = {};
7070
const renewSessionIfNeeded = async ({ config, session, sessionToken }) => {
71-
if (!config?.renewSessions) {
71+
if (!config?.extendSessionOnUse) {
7272
return;
7373
}
7474
clearTimeout(throttle[sessionToken]);

src/Config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class Config {
8686
logLevels,
8787
rateLimit,
8888
databaseOptions,
89-
renewSessions,
89+
extendSessionOnUse,
9090
}) {
9191
if (masterKey === readOnlyMasterKey) {
9292
throw new Error('masterKey and readOnlyMasterKey should be different');
@@ -104,8 +104,8 @@ export class Config {
104104
throw 'revokeSessionOnPasswordReset must be a boolean value';
105105
}
106106

107-
if (typeof renewSessions !== 'boolean') {
108-
throw 'renewSessions must be a boolean value';
107+
if (typeof extendSessionOnUse !== 'boolean') {
108+
throw 'extendSessionOnUse must be a boolean value';
109109
}
110110

111111
if (publicServerURL) {

src/Options/Definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ module.exports.ParseServerOptions = {
437437
env: 'PARSE_SERVER_READ_ONLY_MASTER_KEY',
438438
help: 'Read-only key, which has the same capabilities as MasterKey without writes',
439439
},
440-
renewSessions: {
440+
extendSessionOnUse: {
441441
env: 'PARSE_SERVER_RENEW_SESSIONS',
442442
help: 'Whether Parse Server should automatically extend a valid session by the sessionLength',
443443
action: parsers.booleanParser,

src/Options/docs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export interface ParseServerOptions {
205205
sessionLength: ?number;
206206
/* Whether Parse Server should automatically extend a valid session by the sessionLength
207207
:DEFAULT: false */
208-
renewSessions: ?boolean;
208+
extendSessionOnUse: ?boolean;
209209
/* Default value for limit option on queries, defaults to `100`.
210210
:DEFAULT: 100 */
211211
defaultLimit: ?number;

0 commit comments

Comments
 (0)