diff --git a/.all-contributorsrc b/.all-contributorsrc
index c6fe8646b..1a28fb5e9 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -205,6 +205,33 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "ugoconsonni",
+ "name": "ugoconsonni",
+ "avatar_url": "https://avatars.githubusercontent.com/u/13661702?v=4",
+ "profile": "https://github.com/ugoconsonni",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "daniel-mutwiri",
+ "name": "Daniel Mutwiri",
+ "avatar_url": "https://avatars.githubusercontent.com/u/8936960?v=4",
+ "profile": "https://github.com/daniel-mutwiri",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "Zathiel",
+ "name": "Zathiel",
+ "avatar_url": "https://avatars.githubusercontent.com/u/26553418?v=4",
+ "profile": "https://github.com/Zathiel",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --git a/README.md b/README.md
index 82a1c3b4c..24e1046fc 100644
--- a/README.md
+++ b/README.md
@@ -134,6 +134,9 @@ We would like to thank all our contributors and users for their support and feed
 Vikram 💻 |
+  ugoconsonni 💻 |
+  Daniel Mutwiri 💻 |
+  Zathiel 💻 |
diff --git a/apps/OpenSign/src/App.js b/apps/OpenSign/src/App.js
index 929008576..40bebb3de 100644
--- a/apps/OpenSign/src/App.js
+++ b/apps/OpenSign/src/App.js
@@ -109,6 +109,10 @@ function App() {
path="/login/:id/:userMail/:contactBookId/:serverUrl"
element={}
/>
+ }
+ />
} />
new Date());
const LocalUserDetails = {
name: details.Name,
@@ -125,7 +125,7 @@ const GoogleSignInBtn = ({
company: extRes.get("Company")
};
localStorage.setItem("userDetails", JSON.stringify(LocalUserDetails));
- thirdpartyLoginfn(payload.sessiontoken, billingDate);
+ thirdpartyLoginfn(payload.sessiontoken);
}
return { msg: "exist" };
} else {
diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js
index 7cbe4851e..003ef60bb 100644
--- a/apps/OpenSign/src/pages/GuestLogin.js
+++ b/apps/OpenSign/src/pages/GuestLogin.js
@@ -6,9 +6,10 @@ import axios from "axios";
import { isEnableSubscription, themeColor } from "../constant/const";
import { contractUsers, getAppLogo } from "../constant/Utils";
import logo from "../assets/images/logo.png";
+import { appInfo } from "../constant/appinfo";
function GuestLogin() {
- const { id, userMail, contactBookId, serverUrl } = useParams();
+ const { id, userMail, contactBookId, base64url } = useParams();
let navigate = useNavigate();
const [email, setEmail] = useState(userMail);
const [OTP, setOTP] = useState("");
@@ -16,7 +17,8 @@ function GuestLogin() {
const [loading, setLoading] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const [appLogo, setAppLogo] = useState("");
-
+ const [documentId, setDocumentId] = useState(id);
+ const [contactId, setContactId] = useState(contactBookId);
useEffect(() => {
handleServerUrl();
@@ -36,17 +38,24 @@ function GuestLogin() {
setAppLogo(logo);
}
- //split url in array from '&'
localStorage.clear();
- const checkSplit = serverUrl.split("&");
- const server = checkSplit[0];
- const parseId = checkSplit[1];
- const appName = checkSplit[2];
-
- const newServer = server.replaceAll("%2F", "/");
+ const parseId = appInfo.appId;
+ const newServer = `${appInfo.baseUrl}/`;
+ const appName = appInfo.appname;
localStorage.setItem("baseUrl", newServer);
localStorage.setItem("parseAppId", parseId);
localStorage.setItem("_appName", appName);
+ //this condition is used decode base64 to string and get userEmail,documentId, contactBoookId data.
+ if (!id) {
+ //`atob` function is used to decode base64
+ const decodebase64 = atob(base64url);
+ //split url in array from '/'
+ const checkSplit = decodebase64.split("/");
+ setDocumentId(checkSplit[0]);
+ setEmail(checkSplit[1]);
+ setContactId(checkSplit[2]);
+ }
+
setIsLoading(false);
};
@@ -74,7 +83,7 @@ function GuestLogin() {
};
let body = {
email: email.toString(),
- docId: id
+ docId: documentId
};
let Otp = await axios.post(url, body, { headers: headers });
@@ -137,7 +146,7 @@ function GuestLogin() {
//save isGuestSigner true in local to handle login flow header in mobile view
localStorage.setItem("isGuestSigner", true);
setLoading(false);
- navigate(`/load/recipientSignPdf/${id}/${contactBookId}`);
+ navigate(`/load/recipientSignPdf/${documentId}/${contactId}`);
}
} catch (error) {
console.log("err ", error);
diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js
index 2b050dab1..a2e4b401c 100644
--- a/apps/OpenSign/src/pages/Login.js
+++ b/apps/OpenSign/src/pages/Login.js
@@ -422,7 +422,7 @@ function Login() {
alert("Somenthing went wrong, please try again later!");
}
};
- const thirdpartyLoginfn = async (sessionToken, billingDate) => {
+ const thirdpartyLoginfn = async (sessionToken) => {
const baseUrl = localStorage.getItem("baseUrl");
const parseAppId = localStorage.getItem("parseAppId");
const res = await axios.get(baseUrl + "users/me", {
@@ -521,7 +521,7 @@ function Login() {
await Parse.Cloud.run("getUserDetails", {
email: currentUser.get("email")
}).then(
- (result) => {
+ async (result) => {
let tenentInfo = [];
const results = [result];
if (results) {
@@ -571,7 +571,7 @@ function Login() {
setState({ ...state, loading: false });
navigate("/");
} else {
- extendedInfo.forEach((x) => {
+ extendedInfo.forEach(async (x) => {
if (x.TenantId) {
let obj = {
tenentId: x.TenantId.objectId,
@@ -608,8 +608,13 @@ function Login() {
setThirdpartyLoader(false);
setState({ ...state, loading: false });
if (isEnableSubscription) {
- if (billingDate) {
- if (billingDate > new Date()) {
+ const res = await fetchSubscription();
+ const freeplan = res.plan;
+ const billingDate = res.billingDate;
+ if (freeplan === "freeplan") {
+ navigate(redirectUrl);
+ } else if (billingDate) {
+ if (new Date(billingDate) > new Date()) {
localStorage.removeItem("userDetails");
navigate(redirectUrl);
} else {
@@ -644,8 +649,13 @@ function Login() {
setState({ ...state, loading: false });
setThirdpartyLoader(false);
if (isEnableSubscription) {
- if (billingDate) {
- if (billingDate > new Date()) {
+ const res = await fetchSubscription();
+ const freeplan = res.plan;
+ const billingDate = res.billingDate;
+ if (freeplan === "freeplan") {
+ navigate(redirectUrl);
+ } else if (billingDate) {
+ if (new Date(billingDate) > new Date()) {
localStorage.removeItem("userDetails");
// Redirect to the appropriate URL after successful login
navigate(redirectUrl);
diff --git a/apps/OpenSign/src/pages/Opensigndrive.js b/apps/OpenSign/src/pages/Opensigndrive.js
index 0803cb8bb..12d1c0f61 100644
--- a/apps/OpenSign/src/pages/Opensigndrive.js
+++ b/apps/OpenSign/src/pages/Opensigndrive.js
@@ -64,6 +64,7 @@ function Opensigndrive() {
const sortingValue = ["Name", "Date"];
const [isDontShow, setIsDontShow] = useState(false);
const [tourData, setTourData] = useState();
+ const [showTourFirstTIme, setShowTourFirstTime] = useState(true);
const orderName = {
Ascending: "Ascending",
Descending: "Descending",
@@ -134,7 +135,9 @@ function Opensigndrive() {
//function for get all pdf document list
const getPdfDocumentList = async (disbaleLoading) => {
setLoading(true);
- checkTourStatus();
+ if (showTourFirstTIme) {
+ checkTourStatus();
+ }
if (!disbaleLoading) {
setIsLoading({ isLoad: true, message: "This might take some time" });
}
@@ -250,17 +253,23 @@ function Opensigndrive() {
}, [loading, sortingOrder, selectedSort]); // Add/remove scroll event listener when loading changes
//function for handle folder name path
- const handleRoute = (index) => {
- setPdfData([]);
+ const handleRoute = (index, folderData) => {
setSkip(0);
+ // after onclick on route filter route from that index
const updateFolderName = folderName.filter((x, i) => {
if (i <= index) {
return x;
}
});
setFolderName(updateFolderName);
+ //get route details after onclick path of folder name
+ const getCurrentId = folderData[index];
const getLastId = updateFolderName[updateFolderName.length - 1];
- setDocId(getLastId.objectId);
+ //below condition is used to check if user click on same route which already open then don't change any thing
+ if (docId !== getCurrentId.objectId) {
+ setPdfData([]);
+ setDocId(getLastId.objectId);
+ }
};
//function for add new folder name
@@ -439,7 +448,7 @@ function Opensigndrive() {
return (
handleRoute(id)}
+ onClick={() => handleRoute(id, folderData)}
style={{
color: "#a64b4e",
fontWeight: "400",
@@ -474,6 +483,7 @@ function Opensigndrive() {
const closeTour = async () => {
setIsTour(false);
+ setShowTourFirstTime(false);
if (isDontShow) {
const serverUrl = localStorage.getItem("baseUrl");
const appId = localStorage.getItem("parseAppId");
diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js
index d16ab1abf..ddde34778 100644
--- a/apps/OpenSign/src/pages/PdfRequestFiles.js
+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js
@@ -740,14 +740,13 @@ function PdfRequestFiles() {
localStorage.getItem("parseAppId"),
sessionToken: localStorage.getItem("accesstoken")
};
- const serverUrl = localStorage.getItem("baseUrl");
- const newServer = serverUrl.replaceAll("/", "%2F");
const objectId = user.objectId;
- const serverParams = `${newServer}&${localStorage.getItem(
- "parseAppId"
- )}&${localStorage.getItem("_appName")}`;
const hostUrl = window.location.origin;
- let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${user.Email}/${objectId}/${serverParams}`;
+ //encode this url value `${pdfDetails?.[0].objectId}/${user.Email}/${objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(
+ `${pdfDetails?.[0].objectId}/${user.Email}/${objectId}`
+ );
+ let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl =
"https://www.opensignlabs.com/contact-us";
const orgName = pdfDetails[0]?.ExtUserPtr.Company
@@ -1245,9 +1244,9 @@ function PdfRequestFiles() {
isDecline.currnt === "Sure"
? "Are you sure want to decline this document ?"
: isDecline.currnt === "YouDeclined"
- ? "You have declined this document!"
- : isDecline.currnt === "another" &&
- "You can not sign this document as it has been declined/revoked."
+ ? "You have declined this document!"
+ : isDecline.currnt === "another" &&
+ "You can not sign this document as it has been declined/revoked."
}
footerMessage={isDecline.currnt === "Sure"}
declineDoc={declineDoc}
@@ -1340,7 +1339,7 @@ function PdfRequestFiles() {
{
fetchTenantDetails();
@@ -968,15 +967,13 @@ function PlaceHolderSign() {
const shareLinkList = [];
let signerMail = signersdata;
for (let i = 0; i < signerMail.length; i++) {
- const serverUrl = localStorage.getItem("baseUrl");
- const newServer = serverUrl.replaceAll("/", "%2F");
const objectId = signerMail[i].objectId;
- const serverParams = `${newServer}&${localStorage.getItem(
- "parseAppId"
- )}&${localStorage.getItem("_appName")}`;
-
const hostUrl = window.location.origin;
- let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}/${serverParams}`;
+ //encode this url value `${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(
+ `${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}`
+ );
+ let signPdf = `${hostUrl}/login/${encodeBase64}`;
shareLinkList.push({ signerEmail: signerMail[i].Email, url: signPdf });
}
return shareLinkList.map((data, ind) => {
@@ -1050,15 +1047,13 @@ function PlaceHolderSign() {
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
sessionToken: localStorage.getItem("accesstoken")
};
- const serverUrl = localStorage.getItem("baseUrl");
- const newServer = serverUrl.replaceAll("/", "%2F");
const objectId = signerMail[i].objectId;
- const serverParams = `${newServer}&${localStorage.getItem(
- "parseAppId"
- )}&${localStorage.getItem("_appName")}`;
-
const hostUrl = window.location.origin;
- let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}/${serverParams}`;
+ //encode this url value `${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(
+ `${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}`
+ );
+ let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl = "https://www.opensignlabs.com/";
const orgName = pdfDetails[0]?.ExtUserPtr.Company
? pdfDetails[0].ExtUserPtr.Company
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js
index b27e32fdb..927a0e14f 100644
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@ -287,13 +287,15 @@ const ReportTable = (props) => {
const handleShare = (item) => {
setActLoader({ [item.objectId]: true });
const host = window.location.origin;
- const serverUrl = process.env.REACT_APP_SERVERURL
- ? process.env.REACT_APP_SERVERURL
- : window.location.origin + "/api/app";
- const baseURL = serverUrl.replace(/\//g, "%2F");
+ const getUrl = (x) => {
+ //encode this url value `${item.objectId}/${x.Email}/${x.objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(`${item.objectId}/${x.Email}/${x.objectId}`);
+ return `${host}/login/${encodeBase64}`;
+ };
+
const urls = item.Signers.map((x) => ({
email: x.Email,
- url: `${host}/login/${item.objectId}/${x.Email}/${x.objectId}/${baseURL}%2F&opensign&contracts`
+ url: getUrl(x)
}));
setShareUrls(urls);
setIsShare({ [item.objectId]: true });
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
index 88be8b248..9b5c9e8fa 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
@@ -218,9 +218,10 @@ export default async function createDocumentWithTemplate(request, response) {
};
const objectId = contactMail[i].contactPtr.objectId;
-
const hostUrl = baseUrl.origin;
- let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
+ //encode this url value `${res.id}/${contactMail[i].email}/${objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(`${res.id}/${contactMail[i].email}/${objectId}`);
+ let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = template.ExtUserPtr.Company ? template.ExtUserPtr.Company : '';
const themeBGcolor = '#47a3ad';
@@ -321,7 +322,9 @@ export default async function createDocumentWithTemplate(request, response) {
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
- url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
+ url: `${baseUrl.origin}/login/${btoa(
+ `${res.id}/${x.email}/${x.contactPtr.objectId}`
+ )}`,
})),
message: 'Document sent successfully!',
});
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
index 37dea278e..49a7aca18 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
@@ -279,7 +279,9 @@ export default async function createDocumentwithCoordinate(request, response) {
const objectId = contactMail[i].contactPtr.objectId;
const hostUrl = baseUrl.origin;
- let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
+ //encode this url value `${response.id}/${contactMail[i].email}/${objectId}` to base64 using `btoa` function
+ const encodeBase64 = btoa(`${response.id}/${contactMail[i].email}/${objectId}`);
+ let signPdf = `${hostUrl}/login/${encodeBase64}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = parseExtUser.Company ? parseExtUser.Company : '';
const themeBGcolor = '#47a3ad';
@@ -364,7 +366,7 @@ export default async function createDocumentwithCoordinate(request, response) {
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
- url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
+ url: `${baseUrl.origin}/login/${btoa(`${res.id}/${x.email}/${x.contactPtr.objectId}`)}`,
})),
message: 'Document sent successfully!',
});