Skip to content

Commit

Permalink
Let user pick rp id instead of automatically selecting the first rp id.
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-snake committed Feb 20, 2025
1 parent d8e558b commit d217b9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/frontend/src/components/authenticateBox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ export const handleLoginFlowResult = async <E>(
| PossiblyWrongWebAuthnFlow
| PinUserOtherDomain
| FlowError
| LoginCancel
): Promise<
({ userNumber: bigint; connection: AuthenticatedConnection } & E) | undefined
> => {
Expand Down Expand Up @@ -405,10 +404,6 @@ export const handleLoginFlowResult = async <E>(
return undefined;
}

if (result.kind === "loginCancel") {
return undefined;
}

result satisfies FlowError;

toast.error(flowErrorToastTemplate(result));
Expand Down
9 changes: 2 additions & 7 deletions src/frontend/src/utils/iiConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ export class Connection {
| PinUserOtherDomain
| UnknownUser
| ApiError
| LoginCancel
> => {
let devices: Omit<DeviceData, "alias">[];
try {
Expand Down Expand Up @@ -440,11 +439,7 @@ export class Connection {
rpIds: Array<string | undefined>
) => Promise<RpIdPickSuccess | RpIdPickCancelled>
): Promise<
| LoginSuccess
| WebAuthnFailed
| PossiblyWrongWebAuthnFlow
| AuthFail
| LoginCancel
LoginSuccess | WebAuthnFailed | PossiblyWrongWebAuthnFlow | AuthFail
> => {
if (DOMAIN_COMPATIBILITY.isEnabled()) {
// Create flows if not initialized yet
Expand Down Expand Up @@ -473,7 +468,7 @@ export class Connection {
) {
const result = await pickRpId(uniqueRpIds);
if (result.kind === "rpIdPickCancelled") {
return { kind: "loginCancel" };
return { kind: "webAuthnFailed" };
}
void (result satisfies RpIdPickSuccess);

Expand Down

0 comments on commit d217b9e

Please sign in to comment.