added in oauth fo dev
This commit is contained in:
@@ -7,6 +7,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import PaginationControl from "./pagination";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
import CryptoJS from "crypto-js";
|
||||
|
||||
import {
|
||||
getBasicSearch,
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
getSearchDocumentHistory1,
|
||||
getSearchDocumentHistory1Paged,
|
||||
getSearchDocumentDetails1Paged,
|
||||
getSASToken,
|
||||
getToken,
|
||||
} from "../../actions";
|
||||
|
||||
import {
|
||||
@@ -106,7 +107,9 @@ const DocumentDetails = (props) => {
|
||||
<a
|
||||
href={
|
||||
"/api/proxy/documents/download/" +
|
||||
detailsObj.pinswg_isharedocumentreference
|
||||
encryptDocReference(
|
||||
detailsObj.pinswg_isharedocumentreference
|
||||
)
|
||||
}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
@@ -191,6 +194,17 @@ const DocumentDetails = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const encryptDocReference = (documentRef) => {
|
||||
var encrypted = encodeURIComponent(
|
||||
CryptoJS.AES.encrypt(
|
||||
documentRef,
|
||||
process.env.NEXT_PUBLIC_ISHARESECRETPHRASE
|
||||
)
|
||||
);
|
||||
|
||||
return encrypted;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const docDetailsObj = async () => {
|
||||
let docObj = await getSearchDocumentDetails1(incidentid)
|
||||
|
||||
Reference in New Issue
Block a user