Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Surface token exchange errors via info() logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert committed Jul 20, 2016
1 parent f1abe55 commit d11e981
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/helpers/exchange-stormpath-token.js
Expand Up @@ -36,5 +36,11 @@ module.exports = function exchangeStormpathToken(req, account, callback) {
stormpath_token: token.compact()
};

authenticator.authenticate(options, callback);
authenticator.authenticate(options, function errorLogger() {
if (arguments[0] !== null) {
var logger = req.app.get('stormpathLogger');
logger.info('Token exchange failed', arguments[0]);
}
callback.apply(null, arguments);
});
};

0 comments on commit d11e981

Please sign in to comment.