Add firebase auth to JSR call.

This commit is contained in:
Patrick Fic
2023-05-04 13:33:16 -07:00
parent abe5fadeea
commit 2586855f11

View File

@@ -3,7 +3,7 @@ import { notification } from "antd";
import jsreport from "@jsreport/browser-client";
import _ from "lodash";
import moment from "moment";
//import { auth } from "../firebase/firebase.utils";
import { auth } from "../firebase/firebase.utils";
import { setEmailOptions } from "../redux/email/email.actions";
import { store } from "../redux/store";
import client from "../utils/GraphQLClient";
@@ -309,8 +309,8 @@ export const GenerateDocuments = async (templates) => {
const fetchContextData = async (templateObject, jsrAuth) => {
const bodyshop = store.getState().user.bodyshop;
// jsreport.headers["Authorization"] =
// "Bearer " + (await auth.currentUser.getIdToken());
jsreport.headers["FirebaseAuthorization"] =
"Bearer " + (await auth.currentUser.getIdToken());
const folders = await cleanAxios.get(`${server}/odata/folders`, {
headers: { Authorization: jsrAuth },