IO-3498 QBO Auth Token
Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
@@ -45,7 +45,7 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
exports.refresh = async (oauthClient, req) => {
|
exports.refresh = async (oauthClient, req) => {
|
||||||
try {
|
try {
|
||||||
// logger.log("qbo-token-refresh", "DEBUG", req.user.email, null, null);
|
logger.log("qbo-token-refresh", "DEBUG", req.user.email, null, null);
|
||||||
const authResponse = await oauthClient.refresh();
|
const authResponse = await oauthClient.refresh();
|
||||||
await client.request(queries.SET_QBO_AUTH, {
|
await client.request(queries.SET_QBO_AUTH, {
|
||||||
email: req.user.email,
|
email: req.user.email,
|
||||||
@@ -59,10 +59,12 @@ exports.refresh = async (oauthClient, req) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.setNewRefreshToken = async (email, apiResponse) => {
|
exports.setNewRefreshToken = async (email, apiResponse) => {
|
||||||
//logger.log("qbo-token-updated", "DEBUG", email, null, null);
|
// Deprecated - tokens are now auto-updated in the oauthClient and the token isn't pushed back from QBO API calls anymore
|
||||||
|
|
||||||
await client.request(queries.SET_QBO_AUTH, {
|
// logger.log("qbo-token-updated", "DEBUG", email, null, {apiResponse: apiResponse});
|
||||||
email,
|
|
||||||
qbo_auth: { ...apiResponse.token, createdAt: Date.now() }
|
// await client.request(queries.SET_QBO_AUTH, {
|
||||||
});
|
// email,
|
||||||
|
// qbo_auth: { ...apiResponse.token, createdAt: Date.now() }
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user