added encypted document link
This commit is contained in:
+3
-1
@@ -33,4 +33,6 @@ I18N_DOMAIN = "cymru.local"
|
|||||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
SHOWLOGIN = "false"
|
SHOWLOGIN = "false"
|
||||||
SHOWREPRESENTATIONS = "false"
|
SHOWREPRESENTATIONS = "false"
|
||||||
BASIC_AUTH_CREDENTIALS,,= pinswg:password|pinswg2:password2
|
BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
|
||||||
|
|
||||||
|
NEXT_PUBLIC_ISHARESECRETPHRASE = "Secret phrase"
|
||||||
@@ -7,6 +7,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
|||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import PaginationControl from "./pagination";
|
import PaginationControl from "./pagination";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getBasicSearch,
|
getBasicSearch,
|
||||||
@@ -106,7 +107,9 @@ const DocumentDetails = (props) => {
|
|||||||
<a
|
<a
|
||||||
href={
|
href={
|
||||||
"/api/proxy/documents/download/" +
|
"/api/proxy/documents/download/" +
|
||||||
detailsObj.pinswg_isharedocumentreference
|
encryptDocReference(
|
||||||
|
detailsObj.pinswg_isharedocumentreference
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="results-visually-hidden">
|
<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(() => {
|
useEffect(() => {
|
||||||
const docDetailsObj = async () => {
|
const docDetailsObj = async () => {
|
||||||
let docObj = await getSearchDocumentDetails1(incidentid)
|
let docObj = await getSearchDocumentDetails1(incidentid)
|
||||||
|
|||||||
Reference in New Issue
Block a user