diff --git a/inji-verify/src/pages/OvpRedirect.tsx b/inji-verify/src/pages/OvpRedirect.tsx index ac61f9b3..8c4d4386 100644 --- a/inji-verify/src/pages/OvpRedirect.tsx +++ b/inji-verify/src/pages/OvpRedirect.tsx @@ -13,9 +13,9 @@ function OvpRedirect(props: any) { const dispatch = useAppDispatch(); useEffect(() => { - let vpToken, presentationSubmission, error, errorDescription; + let vpToken, presentationSubmission, params, error, errorDescription; try { - const params = new URLSearchParams(location.hash.substring(1)); + params = new URLSearchParams(location.hash.substring(1)); const queryParams = new URLSearchParams(location.search.substring(1)); vpToken = !!params.get("vp_token") @@ -32,9 +32,11 @@ function OvpRedirect(props: any) { console.error("Error occurred while reading params in redirect url, Error: ", error); } finally { - navigate(Pages.Home); if (!!vpToken && !!presentationSubmission) { dispatch(verificationInit({ovp: {vpToken, presentationSubmission}})); + params?.delete("vp_token"); + params?.delete("presentation_submission"); + navigate(Pages.Home, { replace: true }); } else if (!!error) { dispatch(raiseAlert( {