@@ -19,6 +19,7 @@ import {
1919import { WALLET_TYPES } from 'lib/wallet';
2020import useLoginView from 'lib/useLoginView';
2121import useBreakpoints from 'lib/useBreakpoints';
22+
2223import {
2324 composeValidator,
2425 buildCheckboxValidator,
@@ -31,6 +32,7 @@ import SubmitButton from 'form/SubmitButton';
3132import Condition from 'form/Condition';
3233import { FORM_ERROR } from 'final-form';
3334import { HdPathInput } from 'form/Inputs';
35+import { getAuthToken } from 'lib/authToken';
3436
3537const PATH_OPTIONS = [
3638 { text: 'Ledger Live', value: LEDGER_LIVE_PATH },
@@ -45,7 +47,7 @@ const ACCOUNT_OPTIONS = times(20, i => ({
4547export default function Ledger({ className, goHome }) {
4648 useLoginView(WALLET_TYPES.LEDGER);
4749
48− const { setWallet, setWalletHdPath } = useWallet();
50+ const { setWallet, setWalletHdPath, setAuthToken } = useWallet();
4951
5052 const validate = useMemo(
5153 () =>
@@ -70,14 +72,21 @@ export default function Ledger({ className, goHome }) {
7072 const chainCode = Buffer.from(info.chainCode, 'hex');
7173 const pub = secp256k1.publicKeyConvert(publicKey, true);
7274 const hd = bip32.fromPublicKey(pub, chainCode);
75+ const authToken = await getAuthToken({
76+ wallet: hd,
77+ walletType: WALLET_TYPES.LEDGER,
78+ walletHdPath: addHdPrefix(values.hdpath),
79+ });
7380
81+ setAuthToken(authToken);
7482 setWallet(Just(hd));
7583 setWalletHdPath(addHdPrefix(values.hdpath));
7684 } catch (error) {
85+ console.error(error);
7786 return { [FORM_ERROR]: error.message };
7887 }
7988 },
80− [setWallet, setWalletHdPath]
89+ [setAuthToken, setWallet, setWalletHdPath]
8190 );
8291
8392 const onValues = useCallback(({ valid, values, form }) => {
@@ -154,7 +163,8 @@ export default function Ledger({ className, goHome }) {
154163 Connect and authenticate to your Ledger, and then open the "Ethereum"
155164 application. If you're running on older firmware, make sure the "browser
156165 support" option is turned on. To sign transactions, you'll also need to
157− enable the "contract data" option.
166+ enable the "contract data" option. You will be prompted to sign a
167+ message. This allows Bridge to operate correctly.
158168 </Grid.Item>
159169
160170 <BridgeForm