Skip to content

Commit

Permalink
feat(sofi-referral): remove migration handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodriguez-bc authored and mperdomo-bc committed Jan 26, 2024
1 parent 7f21793 commit 47e9e1e
Showing 1 changed file with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,11 @@ import { Redirect, RouteComponentProps } from 'react-router-dom'

const SofiReferralComponent: React.FC<RouteComponentProps> = ({ location }) => {
const searchParams = new URLSearchParams(location.search)
const hasAllRequiredJwtParams = ['aesCiphertext', 'aesIV', 'aesTag', 'aesKeyCiphertext'].every(
(param) => searchParams.has(param)
)
const viewParam = searchParams.get('buy')
const queryString = viewParam ? `?code=${viewParam}` : '?ref=sofi'
const redirectTo = `https://blockchainwallet.page.link/buysofi${queryString}`

let redirectTo = ''
let queryString = ''

if (hasAllRequiredJwtParams) {
redirectTo = '/sofi'
queryString = location.search
} else {
redirectTo = 'https://blockchainwallet.page.link/buysofi'
const viewParam = searchParams.get('buy')
if (viewParam) {
queryString = `?code=${viewParam}`
} else {
queryString = '?ref=sofi'
}
}

return <Redirect to={redirectTo + queryString} />
return <Redirect to={redirectTo} />
}

export default SofiReferralComponent

0 comments on commit 47e9e1e

Please sign in to comment.