IO-1145 Remove force token refresh.
This commit is contained in:
@@ -8,7 +8,7 @@ const authProvider = {
|
|||||||
username,
|
username,
|
||||||
password
|
password
|
||||||
);
|
);
|
||||||
const token = await user.getIdToken(true);
|
const token = await user.getIdToken();
|
||||||
localStorage.setItem("token", token);
|
localStorage.setItem("token", token);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export function JobsCloseExportButton({
|
|||||||
{ jobIds: [jobId] },
|
{ jobIds: [jobId] },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -64,7 +64,7 @@ export function JobsCloseExportButton({
|
|||||||
QbXmlResponse.data,
|
QbXmlResponse.data,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -86,7 +86,7 @@ export function JobsCloseExportButton({
|
|||||||
failedTransactions.forEach((ft) => {
|
failedTransactions.forEach((ft) => {
|
||||||
//insert failed export log
|
//insert failed export log
|
||||||
notification.open({
|
notification.open({
|
||||||
// key: "failedexports",
|
// key: "failedexports",
|
||||||
type: "error",
|
type: "error",
|
||||||
message: t("jobs.errors.exporting", {
|
message: t("jobs.errors.exporting", {
|
||||||
error: ft.errorMessage || "",
|
error: ft.errorMessage || "",
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function JobsExportAllButton({
|
|||||||
{ jobIds: jobIds },
|
{ jobIds: jobIds },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -66,7 +66,7 @@ export function JobsExportAllButton({
|
|||||||
QbXmlResponse.data,
|
QbXmlResponse.data,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export function PayableExportAll({
|
|||||||
{ bills: billids },
|
{ bills: billids },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export function PayableExportButton({
|
|||||||
{ bills: [billId] },
|
{ bills: [billId] },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function PaymentExportButton({
|
|||||||
{ payments: [paymentId] },
|
{ payments: [paymentId] },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export function PaymentsExportAllButton({
|
|||||||
{ payments: paymentIds },
|
{ payments: paymentIds },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ if (process.env.NODE_ENV === "production") {
|
|||||||
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||||
async (config) => {
|
async (config) => {
|
||||||
if (!config.headers.Authorization) {
|
if (!config.headers.Authorization) {
|
||||||
const token =
|
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||||
auth.currentUser && (await auth.currentUser.getIdToken(true));
|
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers.Authorization = `Bearer ${token}`;
|
config.headers.Authorization = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user