Skip to content

Commit 0bcfb08

Browse files
committed
additional tips for authenticators and password options
1 parent 7961462 commit 0bcfb08

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

code/client/src/components/OtpTools.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const getQRCodeUri = (otpSeed, otpDisplayName, mode = OTPUriMode.STANDARD
9696
}
9797

9898
// not constructing qrCodeData on the fly (from seed) because generating a PNG takes noticeable amount of time. Caller needs to make sure qrCodeData is consistent with seed
99-
export const buildQRCodeComponent = ({ seed, name, os, isMobile, qrCodeData }) => {
99+
export const buildQRCodeComponent = ({ seed, name, os, isMobile, qrCodeData, qrCodeMode }) => {
100100
const image = (url) =>
101101
<Image
102102
src={qrCodeData}
@@ -107,12 +107,12 @@ export const buildQRCodeComponent = ({ seed, name, os, isMobile, qrCodeData }) =
107107
/>
108108
let href
109109
if (os === OSType.iOS) {
110-
href = getQRCodeUri(seed, name, OTPUriMode.MIGRATION)
110+
href = getQRCodeUri(seed, name, qrCodeMode ?? OTPUriMode.MIGRATION)
111111
} else if (os === OSType.Android) {
112112
href = getQRCodeUri(seed, name, OTPUriMode.STANDARD)
113113
} else if (isMobile) {
114114
// To test in more devices
115-
href = getQRCodeUri(seed, name, OTPUriMode.MIGRATION)
115+
href = getQRCodeUri(seed, name, qrCodeMode ?? OTPUriMode.MIGRATION)
116116
}
117117

118118
return (

code/client/src/pages/Create.jsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { balanceActions } from '../state/modules/balance'
2525
import WalletConstants from '../constants/wallet'
2626
import util, { useWindowDimensions, OSType, generateOtpSeed } from '../util'
2727
import { handleAPIError, handleAddressError } from '../handler'
28-
import {Hint, Heading, InputBox, Warning, Text, Link, Paragraph} from '../components/Text'
28+
import { Hint, Heading, InputBox, Warning, Text, Link, Paragraph, SiderLink } from '../components/Text'
2929
import AddressInput from '../components/AddressInput'
3030
import WalletCreateProgress from '../components/WalletCreateProgress'
3131
import { TallRow } from '../components/Grid'
@@ -38,11 +38,15 @@ import { useTheme, getColorPalette } from '../theme'
3838
import { RedoOutlined } from '@ant-design/icons'
3939
import Slider from 'antd/es/slider'
4040

41-
const getGoogleAuthenticatorAppLink = (os) => {
41+
const getGoogleAuthenticatorUrl = (os) => {
4242
let link = 'https://apps.apple.com/us/app/google-authenticator/id388497605'
4343
if (os === OSType.Android) {
4444
link = 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2'
4545
}
46+
return link
47+
}
48+
const getGoogleAuthenticatorAppLink = (os) => {
49+
const link = getGoogleAuthenticatorUrl(os)
4650
return <Link href={link} target='_blank' rel='noreferrer'>authenticator</Link>
4751
}
4852

@@ -534,13 +538,13 @@ const SetupOtpSection = ({ expertMode, otpReady, setupConfig, walletState, setWa
534538
<Hint>{isMobile ? 'Tap' : 'Scan'} the QR code to setup OTP {getGoogleAuthenticatorAppLink(os)} for the wallet</Hint>
535539
<Hint>Optional: <Link href='#' onClick={toggleShowAccount}>sign-up</Link> to enable backup, alerts, verification code autofill</Hint>
536540
{showAccount && <SignupAccount seed={seed} name={name} address={walletState.predictedAddress} effectiveTime={effectiveTime} setAllowOTPAutoFill={setAllowAutoFill} />}
537-
{buildQRCodeComponent({ seed, name: ONENames.nameWithTime(name, effectiveTime), os, isMobile, qrCodeData: otpQrCodeData })}
541+
{buildQRCodeComponent({ seed, name: ONENames.nameWithTime(name, effectiveTime), os, isMobile, qrCodeData: otpQrCodeData, qrCodeMode })}
538542
</>}
539543
{step === 2 &&
540544
<>
541545
<Heading>Create Your {config.appName} (second code)</Heading>
542546
<Hint align='center'>{isMobile ? 'Tap' : 'Scan'} to setup the <b>second</b> code</Hint>
543-
{buildQRCodeComponent({ seed: seed2, name: ONENames.nameWithTime(getSecondCodeName(name), effectiveTime), os, isMobile, qrCodeData: secondOtpQrCodeData })}
547+
{buildQRCodeComponent({ seed: seed2, name: ONENames.nameWithTime(getSecondCodeName(name), effectiveTime), os, isMobile, qrCodeData: secondOtpQrCodeData, qrCodeMode })}
544548
</>}
545549
</Space>
546550
{step === 1 && (
@@ -603,6 +607,13 @@ const SetupOtpSection = ({ expertMode, otpReady, setupConfig, walletState, setWa
603607
Use Google Auth QR {qrCodeMode === OTPUriMode.MIGRATION && <CheckOutlined />}
604608
</Button>
605609
</Space>)}
610+
{isMobile && (
611+
<Space style={{ marginTop: 32 }} direction='vertical'>
612+
<Hint>
613+
Or go to "Password Options" (after tapping the QR code) and switch verification code app to <SiderLink href={getGoogleAuthenticatorUrl(os)}>Google Authenticator</SiderLink>, or <SiderLink href='https://raivo-otp.com/'>Raivo</SiderLink>, or <SiderLink href='https://getaegis.app/'>Aegis</SiderLink>
614+
</Hint>
615+
</Space>
616+
)}
606617
</AnimatedSection>
607618
)
608619
}

0 commit comments

Comments
 (0)