Skip to content

Commit

Permalink
Add new field to LoginSuccess to show add current device screen
Browse files Browse the repository at this point in the history
  • Loading branch information
lmuntaner committed Dec 20, 2024
1 parent 49d61c5 commit 1989438
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/frontend/src/components/authenticateBox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const authenticateBox = async ({
connection: AuthenticatedConnection;
newAnchor: boolean;
authnMethod: "pin" | "passkey" | "recovery";
showAddCurrentDevice: boolean;
}> => {
const promptAuth = async (autoSelectIdentity?: bigint) =>
authenticateBoxFlow<PinIdentityMaterial>({
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/src/utils/iiConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export type LoginSuccess = {
kind: "loginSuccess";
connection: AuthenticatedConnection;
userNumber: bigint;
showAddCurrentDevice: boolean;
};

export type RegFlowNextStep =
Expand Down Expand Up @@ -323,6 +324,7 @@ export class Connection {
actor
),
userNumber,
showAddCurrentDevice: false,
};
}

Expand Down Expand Up @@ -460,6 +462,7 @@ export class Connection {
kind: "loginSuccess",
userNumber,
connection,
showAddCurrentDevice: cancelledRpIds.size > 0,
};
};
fromIdentity = async (
Expand All @@ -480,6 +483,7 @@ export class Connection {
kind: "loginSuccess",
userNumber,
connection,
showAddCurrentDevice: false,
};
};

Expand Down Expand Up @@ -520,6 +524,7 @@ export class Connection {
userNumber,
actor
),
showAddCurrentDevice: false,
};
};

Expand Down
4 changes: 4 additions & 0 deletions src/showcase/src/flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const registerFlowOpts: RegisterFlowOpts = {
kind: "loginSuccess",
userNumber: BigInt(12356),
connection: mockConnection,
showAddCurrentDevice: false,
};
},
registrationAllowed: true,
Expand Down Expand Up @@ -122,6 +123,7 @@ export const iiFlows: Record<string, () => void> = {
kind: "loginSuccess",
userNumber: BigInt(1234),
connection: mockConnection,
showAddCurrentDevice: false,
});
},
allowPinLogin: true,
Expand All @@ -138,6 +140,7 @@ export const iiFlows: Record<string, () => void> = {
kind: "loginSuccess",
userNumber: BigInt(1234),
connection: mockConnection,
showAddCurrentDevice: false,
});
},
recover: () => {
Expand All @@ -146,6 +149,7 @@ export const iiFlows: Record<string, () => void> = {
kind: "loginSuccess",
userNumber: BigInt(1234),
connection: mockConnection,
showAddCurrentDevice: false,
});
},
retrievePinIdentityMaterial: ({ userNumber }) => {
Expand Down

0 comments on commit 1989438

Please sign in to comment.