Finished refresh/user token auth flow
This commit is contained in:
@@ -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",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user