Add CustomOAuth logger

pull/5146/head
Rodrigo Nascimento 9 years ago
parent 993b6bc51e
commit 5816cae89e
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 12
      packages/rocketchat-custom-oauth/custom_oauth_server.js

@ -1,5 +1,7 @@
/*globals OAuth*/
const logger = new Logger('CustomOAuth');
const Services = {};
export class CustomOAuth {
@ -115,11 +117,17 @@ export class CustomOAuth {
params: params
});
let data;
if (response.data) {
return response.data;
data = response.data;
} else {
return JSON.parse(response.content);
data = JSON.parse(response.content);
}
logger.debug('Identity response', JSON.stringify(data, null, 2));
return data;
} catch (err) {
const error = new Error(`Failed to fetch identity from ${this.name} at ${this.identityPath}. ${err.message}`);
throw _.extend(error, {response: err.response});

Loading…
Cancel
Save