Change session length to 7 days
refs #5202 - this is just a stopgap to deliver minor improvement short term, - longer term we will do the work to refresh refresh tokens & switch this to a month
This commit is contained in:
parent
e99afc65b6
commit
bdf5c9275f
@ -32,7 +32,7 @@ oauth = {
|
||||
var accessToken = utils.uid(256),
|
||||
refreshToken = utils.uid(256),
|
||||
accessExpires = Date.now() + utils.ONE_HOUR_MS,
|
||||
refreshExpires = Date.now() + utils.ONE_DAY_MS;
|
||||
refreshExpires = Date.now() + utils.ONE_WEEK_MS;
|
||||
|
||||
return models.Accesstoken.add({token: accessToken, user_id: user.id, client_id: client.id, expires: accessExpires}).then(function () {
|
||||
return models.Refreshtoken.add({token: refreshToken, user_id: user.id, client_id: client.id, expires: refreshExpires});
|
||||
@ -62,7 +62,7 @@ oauth = {
|
||||
var token = model.toJSON(),
|
||||
accessToken = utils.uid(256),
|
||||
accessExpires = Date.now() + utils.ONE_HOUR_MS,
|
||||
refreshExpires = Date.now() + utils.ONE_DAY_MS;
|
||||
refreshExpires = Date.now() + utils.ONE_WEEK_MS;
|
||||
|
||||
if (token.expires > Date.now()) {
|
||||
models.Accesstoken.add({
|
||||
|
@ -19,13 +19,14 @@ utils = {
|
||||
/**
|
||||
* Timespans in seconds and milliseconds for better readability
|
||||
*/
|
||||
ONE_HOUR_S: 3600,
|
||||
ONE_DAY_S: 86400,
|
||||
ONE_YEAR_S: 31536000,
|
||||
ONE_HOUR_MS: 3600000,
|
||||
ONE_DAY_MS: 86400000,
|
||||
ONE_MONTH_MS: 2628000000,
|
||||
ONE_YEAR_MS: 31536000000,
|
||||
ONE_HOUR_S: 3600,
|
||||
ONE_DAY_S: 86400,
|
||||
ONE_YEAR_S: 31536000,
|
||||
ONE_HOUR_MS: 3600000,
|
||||
ONE_DAY_MS: 86400000,
|
||||
ONE_WEEK_MS: 604800000,
|
||||
ONE_MONTH_MS: 2628000000,
|
||||
ONE_YEAR_MS: 31536000000,
|
||||
|
||||
/**
|
||||
* Return a unique identifier with the given `len`.
|
||||
|
Loading…
Reference in New Issue
Block a user