Adding new logging function
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import fetch from "node-fetch";
|
||||
import { LoggingLevel, smartLogging } from "./helper.js";
|
||||
|
||||
const fetchEbayUserToken = async (authorizationCode) => {
|
||||
smartLogging(LoggingLevel.AppTrace, `fetchEbayUserToken`);
|
||||
const clientId = process.env.EBAY_CLIENT_ID;
|
||||
const clientSecret = process.env.EBAY_CLIENT_SECRET;
|
||||
const redirectUri = process.env.EBAY_REDIRECT_URI; // Make sure this matches the URI registered with eBay
|
||||
@@ -33,7 +35,7 @@ const fetchEbayUserToken = async (authorizationCode) => {
|
||||
const data = await response.json();
|
||||
return data.access_token; // This is the User access token
|
||||
} catch (error) {
|
||||
console.error("Error fetching eBay user token:", error);
|
||||
smartLogging(LoggingLevel.Error,`Error fetching eBay user token: ${JSON.stringify(error)}`);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user