Skip to content

Modular logistics and supply chain operating system (LSOS)

fix(auth): guard two-fa verify against messageless errors

ANSHSINGH05040470e1c6b57eba
diff --git a/console/app/controllers/auth/two-fa.js b/console/app/controllers/auth/two-fa.js
index c61ce73c..5f956a7e 100644
--- a/console/app/controllers/auth/two-fa.js
+++ b/console/app/controllers/auth/two-fa.js
@@ -153,7 +153,7 @@ export default class AuthTwoFaController extends Controller {
return this.router.transitionTo('console');
});
} catch (error) {
- if (error.message.includes('Verification code has expired')) {
+ if (error?.message?.includes('Verification code has expired')) {
this.notifications.info(this.intl.t('auth.two-fa.verify-code.verification-code-expired-notification'));
} else {
this.notifications.error(this.intl.t('auth.two-fa.verify-code.verification-code-failed-notification'));