From c509ac7c84591bb044d97fceef3f2ef3298acf58 Mon Sep 17 00:00:00 2001 From: Justin Tormey Date: Mon, 22 Jul 2019 17:12:29 -0500 Subject: [PATCH] fix(LinkContext): create full deep link with required parameters --- .../src/scenes/VerifyEmailToken/index.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/VerifyEmailToken/index.js b/packages/blockchain-wallet-v4-frontend/src/scenes/VerifyEmailToken/index.js index a73de206e47..8e95baab5f6 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/VerifyEmailToken/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/VerifyEmailToken/index.js @@ -9,6 +9,9 @@ import Error from './template.error' import { Wrapper } from 'components/Public' const VALID_CONTEXTS = ['PIT_SIGNUP', 'KYC', 'SETTINGS'] +const PARAM_DEEP_LINK_PATH = 'email_verified' +const PARAM_ISI = '493253309' +const PARAM_IBI = 'com.rainydayapps.Blockchain' class VerifyEmailToken extends React.PureComponent { state = { @@ -27,12 +30,21 @@ class VerifyEmailToken extends React.PureComponent { const isProdEnv = this.props.appEnv === 'prod' const link = isProdEnv - ? 'https://blockchain.page.link/email_verified' - : 'https://blockchainwalletstaging.page.link/email_verified' + ? 'https://blockchain.page.link/' + : 'https://blockchainwalletstaging.page.link/' - const isValidContext = VALID_CONTEXTS.indexOf(context) > -1 + const params = new URLSearchParams() + params.set('deep_link_path', PARAM_DEEP_LINK_PATH) + params.set('isi', PARAM_ISI) + params.set('ibi', PARAM_IBI) - return isValidContext ? `${link}?context=${context}` : link + if (VALID_CONTEXTS.indexOf(context) > -1) { + params.set('context', context) + } + + const deepLinkComponent = `${window.location.origin}/login?${params}` + + return link + '?link=' + encodeURIComponent(deepLinkComponent) } render () {