Skip to content

Commit

Permalink
Merge branch 'darachcawley-pr-timeout'
Browse files Browse the repository at this point in the history
  • Loading branch information
nialldonnellyfh committed Jun 15, 2017
2 parents 4b6e11b + deb2d6b commit d9502de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/cloud/user/mbaas-service-proxy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var q = require('q')
, $fh = require('fh-mbaas-api')
, _ = require('lodash');
, _ = require('lodash')
, config = require('../../config/config-user');

/**
* Proxy for calling MBaaS Service API
Expand All @@ -26,7 +27,8 @@ MbaasServiceProxy.prototype.xhr = function(_options) {
var defaultOptions = {
guid: this.guid,
path: '/api/wfm/user',
method: 'GET'
method: 'GET',
timeout: config.requestTimeout
};

var options = _.defaults(_options, defaultOptions);
Expand Down
3 changes: 2 additions & 1 deletion lib/config/config-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module.exports = {
authpolicyPath: '/box/srv/1.1/admin/authpolicy',
policyId: process.env.WFM_AUTH_POLICY_ID || 'wfm',
defaultProfileDataExclusionList: ['password'],
sessionTokenExpiry: 1800
sessionTokenExpiry: process.env.WFM_TOKEN_EXPIRY || 1800,
requestTimeout: process.env.WFM_REQUEST_TIMEOUT || 25000
};
1 change: 1 addition & 0 deletions lib/mbaas/session/mongoProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
this.db.collection('sessions').findOne({
'_id': token
}, function(err, foundSession) {
foundSession = foundSession || {};
//For the session to be valid, the expiry date must be greater than now.
var valid = !err && foundSession && new Date() < new Date(foundSession.expires);
foundSession.isValid = valid;
Expand Down

0 comments on commit d9502de

Please sign in to comment.