IO-1145 Remove force token refresh.

This commit is contained in:
Patrick Fic
2021-05-18 13:35:48 -07:00
parent be051501ba
commit 043ee68e58
8 changed files with 11 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ const authProvider = {
username,
password
);
const token = await user.getIdToken(true);
const token = await user.getIdToken();
localStorage.setItem("token", token);
return Promise.resolve();
} catch (error) {

View File

@@ -40,7 +40,7 @@ export function JobsCloseExportButton({
{ jobIds: [jobId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -64,7 +64,7 @@ export function JobsCloseExportButton({
QbXmlResponse.data,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -86,7 +86,7 @@ export function JobsCloseExportButton({
failedTransactions.forEach((ft) => {
//insert failed export log
notification.open({
// key: "failedexports",
// key: "failedexports",
type: "error",
message: t("jobs.errors.exporting", {
error: ft.errorMessage || "",

View File

@@ -43,7 +43,7 @@ export function JobsExportAllButton({
{ jobIds: jobIds },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -66,7 +66,7 @@ export function JobsExportAllButton({
QbXmlResponse.data,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -46,7 +46,7 @@ export function PayableExportAll({
{ bills: billids },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -44,7 +44,7 @@ export function PayableExportButton({
{ bills: [billId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -43,7 +43,7 @@ export function PaymentExportButton({
{ payments: [paymentId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -42,7 +42,7 @@ export function PaymentsExportAllButton({
{ payments: paymentIds },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -9,8 +9,7 @@ if (process.env.NODE_ENV === "production") {
export const axiosAuthInterceptorId = axios.interceptors.request.use(
async (config) => {
if (!config.headers.Authorization) {
const token =
auth.currentUser && (await auth.currentUser.getIdToken(true));
const token = auth.currentUser && (await auth.currentUser.getIdToken());
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}