Finished refresh/user token auth flow

This commit is contained in:
2024-03-23 23:47:46 -05:00
parent 6dddc5799f
commit 461b311347
7 changed files with 110 additions and 146 deletions

View File

@@ -1,9 +1,9 @@
import fetch from "node-fetch";
import fetchEbayReadToken from "../utils/fetchEbayReadToken.js"; // Adjust the import path according to your project structure
import fetchEbayToken from "../utils/fetchEbayReadToken.js";
export const itemLookup = async (req, res) => {
const productCode = req.query.productCode;
const oauthToken = await fetchEbayReadToken();
const token = await fetchEbayToken();
console.log(productCode);
try {
const response = await fetch(
@@ -11,7 +11,7 @@ export const itemLookup = async (req, res) => {
{
method: "GET",
headers: {
Authorization: `Bearer ${oauthToken}`,
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
}