Reverse CORS & Fix Cookie Setting.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
17
server.js
17
server.js
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user