on master help sign in
activate: new master ticket is non-deterministic

Previously, the new master ticket was being generated deterministically from the invite ticket and point. This resulted in the passport's wallet having the same master ticket as the invite. So, this commit changes the wallet generation to use a ticket generated with non-deterministic `makeTicket` function.

commita7364972ebcb7dc8394bd496e56c071bac54a19c authortomholford <tomholford@users.noreply.github.com> dateThu 20 Jan 2022, 00:27 (5 years ago) parente2e7227
1 file changed+11−4
src/views/Activate/ActivateCodeForm.tsx+11−4
src/views/Activate/ActivateCodeForm.tsx+11−4
@@ -4,7 +4,11 @@ import { WARNING } from 'form/helpers';
44import { FORM_ERROR } from 'final-form';
55import { Just } from 'folktale/maybe';
66import BridgeForm from 'form/BridgeForm';
7−import { PLACEHOLDER_PLANET, PLACEHOLDER_TICKET, TicketInput } from 'form/Inputs';
7+import {
8+ PLACEHOLDER_PLANET,
9+ PLACEHOLDER_TICKET,
10+ TicketInput,
11+} from 'form/Inputs';
812import {
913 composeValidator,
1014 buildPatqValidator,
@@ -18,7 +22,7 @@ import { useActivateFlow } from './ActivateFlow';
1822import WarningBox from 'components/WarningBox';
1923import useRoller from 'lib/useRoller';
2024import useImpliedTicket from 'lib/useImpliedTicket';
21−import { generateWallet } from 'lib/walletgen';
25+import { generateWallet, makeTicket } from 'lib/walletgen';
2226import { urbitWalletFromTicket, walletFromMnemonic } from 'lib/wallet';
2327import { DEFAULT_HD_PATH, POINT_PROXIES } from 'lib/constants';
2428import useBreakpoints from 'lib/useBreakpoints';
@@ -153,7 +157,11 @@ const ActivateCodeForm = ({ afterSubmit }: ActivateCodeFormProps) => {
153157 setDerivedPatp(Just(ob.patp(point)));
154158 setDerivedPoint(Just(point));
155159 setDerivedPointDominion(Just(rollerPoint.dominion));
156− setInviteMasterTicketWallet(Just(await generateWallet(point, ticket, true)));
160+
161+ const newMasterTicket = await makeTicket(point);
162+ setInviteMasterTicketWallet(
163+ Just(await generateWallet(point, newMasterTicket, true))
164+ );
157165 setIsIn(false);
158166 await timeout(100);
159167 } else {
@@ -176,7 +184,6 @@ const ActivateCodeForm = ({ afterSubmit }: ActivateCodeFormProps) => {
176184 setDerivedPointDominion,
177185 setInviteMasterTicketWallet,
178186 setIsIn,
179− setSendWallet,
180187 ]
181188 );
182189