integration of authentication

This commit is contained in:
2024-08-06 17:44:09 +02:00
parent d38817f4c5
commit e7a78dcaad
21 changed files with 526 additions and 127 deletions
+13 -6
View File
@@ -5,6 +5,9 @@ const {ScraperTools} = require('../AuctionServices/Scraper/Scraper.js')
const Drouot = require('../AuctionServices/Scraper/Drouot/Drouot.js')
const Interencheres = require('../AuctionServices/Scraper/Interencheres/Interencheres.js')
const {config} = require('../config.js');
const { Key } = require("../.Key.js");
let getAuctionPlatform = function(Url){
@@ -88,7 +91,7 @@ exports.getLotList = asyncHandler(async (req, res, next) => {
}
});
// ## AGENT PUPPETEER
// ## AGENT PUPPETEER/PLAYWRIGHT
//Follow a live Sale
exports.followSale = asyncHandler(async (req, res, next) => {
@@ -103,12 +106,16 @@ exports.followSale = asyncHandler(async (req, res, next) => {
try{
let AuctionPlatform = getAuctionPlatform(url);
if(AuctionPlatform){
console.log('Scrapper followSale : '+encodeURIComponent(url))
fetch('http://agent/internApi/follow/sale/'+encodeURIComponent(url))
fetch(config.agent.urlApi+'/follow/sale/'+encodeURIComponent(url),{
headers: {
'authorization': Key.internToken
}
})
.then(response => {
console.log("fetch OK")
//response.json()
} )
console.log("fetch OK")
//response.json()
} )
.then(saleInfo => {})
.catch(error => {
console.error(error);