Skip to content

Commit

Permalink
Handle invalid device code registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Mar 23, 2024
1 parent abcbc58 commit 7c448b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/mfaDevices/mfaDevices.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default class MfaDevices extends LitElement {
return;
}

if (error.status === 422 && error.data && error.data.errorCode === 'InvalidRequest') {
if (error.status === 422 && error.data && (error.data.errorCode === 'InvalidRequest' || error.data.errorCode === 'DeviceProcessingFailed')) {
logger.log('Failed to register new device because the verification was incorrect.', error);
this.error = 'The verification code was incorrect, please try again.';
this.totpCode = null;
Expand Down Expand Up @@ -568,7 +568,7 @@ export default class MfaDevices extends LitElement {
}
this.totpCode = replacementCode;

if (this.totpCode.lenth === 6) {
if (this.totpCode.length === 6) {
this.completeAuthenticatorRegistration();
}
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"@jridgewell/trace-mapping" "^0.3.24"

"@authress/login@*":
version "2.3.304"
resolved "https://registry.yarnpkg.com/@authress/login/-/login-2.3.304.tgz#a947bc69c20fded108e016ce2cb5715fdbf3e8c3"
integrity sha512-Q9DFHx2yPMvODA9whAxqRdAmilvGuSLl8ntEPJl7EvOKUkgTKMIKRhLiTk0PAb9hdiiWSV0jspqteKn6BXDb8A==
version "2.3.305"
resolved "https://registry.yarnpkg.com/@authress/login/-/login-2.3.305.tgz#848ac414639f397338376a9cbd72437f9ab7cacc"
integrity sha512-2vuWxZ6nQiey5D7q6dJwz5Oo4yAgc//+Lkh0h22QK22ximt+G/7eWeW6K43AHhS8TAjVZlYWIMCSZzhJ86DBQw==
dependencies:
cookie "^0.5.0"
lodash.take "^4.1.1"
Expand Down

0 comments on commit 7c448b7

Please sign in to comment.