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.
let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/receivables`, {
withCredentials: true,
jobIds: [jobId],
});
PartnerResponse = await axios.post(
`/qbo/receivables`,
{
jobIds: [jobId],
},
{ withCredentials: true }
);
} else {
//Default is QBD

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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