Reverse CORS & Fix Cookie Setting.

This commit is contained in:
Patrick Fic
2021-10-13 14:35:39 -07:00
parent 14309b5c96
commit 0ddf009f8f
7 changed files with 51 additions and 32 deletions

View File

@@ -45,10 +45,13 @@ export function JobsCloseExportButton({
//Check if it's a QBO Setup. //Check if it's a QBO Setup.
let PartnerResponse; let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/receivables`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/receivables`,
jobIds: [jobId], {
}); jobIds: [jobId],
},
{ withCredentials: true }
);
} else { } else {
//Default is QBD //Default is QBD

View File

@@ -37,10 +37,13 @@ export function JobsExportAllButton({
let PartnerResponse; let PartnerResponse;
setLoading(true); setLoading(true);
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/receivables`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/receivables`,
jobIds: jobIds, {
}); jobIds: jobIds,
},
{ withCredentials: true }
);
} else { } else {
let QbXmlResponse; let QbXmlResponse;
try { try {

View File

@@ -40,10 +40,13 @@ export function PayableExportAll({
setLoading(true); setLoading(true);
if (!!loadingCallback) loadingCallback(true); if (!!loadingCallback) loadingCallback(true);
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/receivables`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/receivables`,
bills: billids, {
}); bills: billids,
},
{ withCredentials: true }
);
} else { } else {
let QbXmlResponse; let QbXmlResponse;
try { try {

View File

@@ -41,10 +41,13 @@ export function PayableExportButton({
//Check if it's a QBO Setup. //Check if it's a QBO Setup.
let PartnerResponse; let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/payables`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/payables`,
bills: [billId], {
}); bills: [billId],
},
{ withCredentials: true }
);
} else { } else {
//Default is QBD //Default is QBD

View File

@@ -37,10 +37,13 @@ export function PaymentExportButton({
//Check if it's a QBO Setup. //Check if it's a QBO Setup.
let PartnerResponse; let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/payments`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/payments`,
payments: [paymentId], {
}); payments: [paymentId],
},
{ withCredentials: true }
);
} else { } else {
//Default is QBD //Default is QBD

View File

@@ -35,10 +35,13 @@ export function PaymentsExportAllButton({
if (!!loadingCallback) loadingCallback(true); if (!!loadingCallback) loadingCallback(true);
let PartnerResponse; let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/payments`, { PartnerResponse = await axios.post(
withCredentials: true, `/qbo/payments`,
payments: paymentIds, {
}); payments: paymentIds,
},
{ withCredentials: true }
);
} else { } else {
let QbXmlResponse; let QbXmlResponse;
try { try {

View File

@@ -46,14 +46,15 @@ app.use(bodyParser.json({ limit: "50mb" }));
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true })); app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
//app.use(enforce.HTTPS({ trustProtoHeader: true })); //app.use(enforce.HTTPS({ trustProtoHeader: true }));
app.use( app.use(
cors({ cors()
credentials: true, // {
origin: [ // credentials: true,
"https://test.imex.online", // origin: [
"http://localhost:3000", // "https://test.imex.online",
"https://imex.online", // "http://localhost:3000",
], // "https://imex.online",
}) // ],
// }
); );
//Email Based Paths. //Email Based Paths.