Skip to content

Commit

Permalink
fix(LinkContext): Correctly separate link params and deep link params
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore3 committed Jul 24, 2019
1 parent 65f8eda commit 0db52b2
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,22 @@ class VerifyEmailToken extends React.PureComponent {
? 'https://blockchain.page.link/'
: 'https://blockchainwalletstaging.page.link/'

const params = new URLSearchParams()
params.set('deep_link_path', PARAM_DEEP_LINK_PATH)
params.set('isi', PARAM_ISI)
params.set('ibi', PARAM_IBI)
params.set('apn', PARAM_APN)
const deepLinkParams = new URLSearchParams()
deepLinkParams.set('deep_link_path', PARAM_DEEP_LINK_PATH)

if (VALID_CONTEXTS.indexOf(context) > -1) {
params.set('context', context)
deepLinkParams.set('context', context)
}

const deepLinkComponent = `${window.location.origin}/login?${params}`
const deepLink = `${window.location.origin}/login?${deepLinkParams}`

const params = new URLSearchParams()
params.set('link', encodeURIComponent(deepLink))
params.set('isi', PARAM_ISI)
params.set('ibi', PARAM_IBI)
params.set('apn', PARAM_APN)

return link + '?link=' + encodeURIComponent(deepLinkComponent)
return `${link}?${params}`
}

render () {
Expand Down

0 comments on commit 0db52b2

Please sign in to comment.