Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const LoginErrorScreenSoft = ({ previousAssertionOptions }: Props) => {

const resFinish = await getConnectService().loginContinue(resStart.val);
if (resFinish.err) {
if (resFinish.val.type === ConnectErrorType.Cancel) {
if (resFinish.val.type === ConnectErrorType.Cancel || resFinish.val.type === ConnectErrorType.Untyped) {
return handleSituation(
LoginSituationCode.ClientPasskeyOperationCancelled,
resFinish.val,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const LoginHybridScreen = (resStart: ConnectLoginStartRsp) => {
setLoading(true);
const res = await getConnectService().loginContinue(resStart);
if (res.err) {
if (res.val.type === ConnectErrorType.Cancel) {
if (res.val.type === ConnectErrorType.Cancel || res.val.type === ConnectErrorType.Untyped) {
return handleSituation(LoginSituationCode.ClientPasskeyOperationCancelled, res.val);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const LoginInitScreen: FC<Props> = ({ showFallback = false }) => {

const res = await getConnectService().loginInit(ac);
if (res.err) {
if (res.val.type === ConnectErrorType.Cancel) {
if (res.val.type === ConnectErrorType.Cancel || res.val.type === ConnectErrorType.Untyped) {
return;
}

Expand Down Expand Up @@ -163,7 +163,7 @@ const LoginInitScreen: FC<Props> = ({ showFallback = false }) => {

if (res.err) {
// if a user cancel during CUI, she can try again
if (res.val.type === ConnectErrorType.Cancel) {
if (res.val.type === ConnectErrorType.Cancel || res.val.type === ConnectErrorType.Untyped) {
return handleSituation(LoginSituationCode.ClientPasskeyConditionalOperationCancelled, res.val);
}

Expand Down Expand Up @@ -230,7 +230,7 @@ const LoginInitScreen: FC<Props> = ({ showFallback = false }) => {
const res = await getConnectService().loginContinue(resStart.val);
if (res.err) {
setIdentifierBasedLoading(false);
if (res.val.type === ConnectErrorType.Cancel) {
if (res.val.type === ConnectErrorType.Cancel || res.val.type === ConnectErrorType.Untyped) {
return handleSituation(
LoginSituationCode.ClientPasskeyOperationCancelled,
res.val,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const LoginPasskeyReLoginScreen = () => {

const resFinish = await getConnectService().loginContinue(resStart.val);
if (resFinish.err) {
if (resFinish.val.type === ConnectErrorType.Cancel) {
if (resFinish.val.type === ConnectErrorType.Cancel || resFinish.val.type === ConnectErrorType.Untyped) {
return handleSituation(LoginSituationCode.ClientPasskeyOperationCancelled, resFinish.val);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ const PasskeyListScreen = () => {
case PasskeyListSituationCode.ClientExcludeCredentialsMatch:
setAppendLoading(false);
void getConnectService().recordEventAppendCredentialExistsError(
attestationOptions ?? '',
`${messageCode} ${error?.track()}`,
attestationOptions ?? '',
);
show(<AlreadyExistingModal hide={hide} />);
break;
Expand Down
7 changes: 4 additions & 3 deletions packages/web-core/src/utils/errors/connectErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum ConnectErrorType {
SecurityError,
ExcludeCredentialsMatch,
RaceTimeout,
Untyped,
}

export class ConnectError {
Expand Down Expand Up @@ -68,7 +69,7 @@ export class ConnectError {
case 'InvalidStateError':
return new ConnectError(ConnectErrorType.ExcludeCredentialsMatch, e.message, runtime);
default:
return new ConnectError(ConnectErrorType.InvalidState, e.message, runtime);
return new ConnectError(ConnectErrorType.Untyped, e.message, runtime);
}
}

Expand All @@ -77,9 +78,9 @@ export class ConnectError {
return new ConnectError(ConnectErrorType.Cancel, e.message);
}

return new ConnectError(ConnectErrorType.InvalidState, e.message);
return new ConnectError(ConnectErrorType.Untyped, e.message);
}

return new ConnectError(ConnectErrorType.InvalidState, `unknown ${e}`);
return new ConnectError(ConnectErrorType.Untyped, `unknown ${e}`);
}
}
Loading