Open IhorHryshkov opened 7 years ago
module.exports.getAccessToken = function(bearerToken) { return pg.query('SELECT access_token, access_token_expires_on, client_id, refresh_token, refresh_token_expires_on, user_id FROM oauth_tokens WHERE access_token = $1', [bearerToken]) .then(function(result) { var token = result.rows[0]; return { accessToken: token.access_token, clientId: token.client_id, expires: token.expires, // This position userId: token.userId //And this position }; }); };
Please fix it to:
module.exports.getAccessToken = function(bearerToken) { return pg.query('SELECT access_token, access_token_expires_on, client_id, refresh_token, refresh_token_expires_on, user_id FROM oauth_tokens WHERE access_token = $1', [bearerToken]) .then(function(result) { var token = result.rows[0]; return { accessToken: token.access_token, clientId: token.client_id, expires: token.access_token_expires_on, userId: token.user_id }; }); };
Or:
module.exports.getAccessToken = function(bearerToken) { return pg.query('SELECT access_token, access_token_expires_on AS expires, client_id, refresh_token, refresh_token_expires_on, user_id AS userId FROM oauth_tokens WHERE access_token = $1', [bearerToken]) .then(function(result) { var token = result.rows[0]; return { accessToken: token.access_token, clientId: token.client_id, expires: token.expires, userId: token.userId }; }); };
Could you take this code and create a PR for it?
Please fix it to:
Or: