diff --git a/package.json b/package.json index 5f5d9ee57d..0017433976 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ }, "scripts": { "web": "npm run lingui:compile && NODE_OPTIONS=\"--openssl-legacy-provider\" vite", + "goodid": "export REACT_APP_INDEXJS='./src/index.fv.jsx' && NODE_OPTIONS=\"--openssl-legacy-provider\" vite", "android": "npm run lingui:compile && ENVFILE=.env; npm run copy:gdfont && npm run animation:assets && NODE_OPTIONS=\"--openssl-legacy-provider\" react-native run-android", "ios": "npm run lingui:compile && ENVFILE=.env; npm run animation:assets && NODE_OPTIONS=\"--openssl-legacy-provider\" react-native run-ios", "start:native": "react-native start", @@ -145,6 +146,7 @@ "lottie-ios": "^3.4.0", "lottie-react-native": "^5", "lottie-web": "^5.12.2", + "lz-string": "^1.5.0", "mnid": "^0.1.3", "mobile-device-detect": "^0.4.3", "moment": "^2.29.4", diff --git a/src/components/faceVerification/standalone/context/FVFlowContext.jsx b/src/components/faceVerification/standalone/context/FVFlowContext.jsx index 00dac090a3..2167f6dfce 100644 --- a/src/components/faceVerification/standalone/context/FVFlowContext.jsx +++ b/src/components/faceVerification/standalone/context/FVFlowContext.jsx @@ -1,6 +1,6 @@ // @flow import React, { createContext, useEffect, useRef } from 'react' - +import { decompressFromEncodedURIComponent } from 'lz-string' import useFVFlow from '../hooks/useFVFlow' import DeepLinking from '../../../../lib/utils/deepLinking' @@ -28,6 +28,10 @@ export const FVFlowContext = createContext({ const FVFlowProvider = props => { const unsupportedCopyUrl = DeepLinking.link + const params = useRef(DeepLinking.params).current + + // new version compresses params to support large signatures + const decompressed = JSON.parse(decompressFromEncodedURIComponent(params.lz) || '{}') const { sig, nonce, @@ -38,7 +42,8 @@ const FVFlowProvider = props => { account, chain, isDelta, - } = useRef(DeepLinking.params).current + } = { ...params, ...decompressed } + const { jwt, error } = useFVFlow(sig, nonce, faceIdentifier, account) useEffect(() => { diff --git a/src/config/config.js b/src/config/config.js index 670e54e548..22668efd91 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -231,7 +231,6 @@ const Config = { graphQlUrl: env.REACT_APP_GRAPHQL_URL || 'https://api.thegraph.com/subgraphs/name/gooddollar', chainIdUrl: env.REACT_APP_CHAINID_URL || 'https://chainid.network', networkId, - isFVFlow: env.REACT_APP_BUILD_TARGET === 'FV', estimateGasPrice: env.REACT_APP_ESTIMATE_GAS_PRICE === 'true', defaultGasPrice: parseInt(env.REACT_APP_DEFAULT_GAS_PRICE || 11), defaultTxGas: parseInt(env.REACT_APP_DEFAULT_TX_GAS || 1000000), diff --git a/yarn.lock b/yarn.lock index 15640a1b9d..4a8e3d3fc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6880,6 +6880,7 @@ __metadata: lottie-ios: ^3.4.0 lottie-react-native: ^5 lottie-web: ^5.12.2 + lz-string: ^1.5.0 metro: 0.80.5 metro-core: ^0.80.5 metro-react-native-babel-preset: ^0.77.0 @@ -35458,6 +35459,15 @@ __metadata: languageName: node linkType: hard +"lz-string@npm:^1.5.0": + version: 1.5.0 + resolution: "lz-string@npm:1.5.0" + bin: + lz-string: bin/bin.js + checksum: 1ee98b4580246fd90dd54da6e346fb1caefcf05f677c686d9af237a157fdea3fd7c83a4bc58f858cd5b10a34d27afe0fdcbd0505a47e0590726a873dc8b8f65d + languageName: node + linkType: hard + "magic-string@npm:0.27.0": version: 0.27.0 resolution: "magic-string@npm:0.27.0"