From 711abb165e80b0bebb8f75b8cd2346cf3b3dfcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Wed, 27 Aug 2025 11:44:34 +0200 Subject: [PATCH] display token validation error --- src/i18n/i18n-types.ts | 4 ++-- .../components/UpdateInstanceModalForm.tsx | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/i18n/i18n-types.ts b/src/i18n/i18n-types.ts index ec907a19..a2809126 100644 --- a/src/i18n/i18n-types.ts +++ b/src/i18n/i18n-types.ts @@ -1127,7 +1127,7 @@ type RootTranslation = { */ finish: string /** - * C​o​n​f​i​g​u​r​e​ ​m​f​a + * C​o​n​f​i​g​u​r​e​ ​M​F​A */ mfa: string } @@ -2795,7 +2795,7 @@ export type TranslationFunctions = { */ finish: () => LocalizedString /** - * Configure mfa + * Configure MFA */ mfa: () => LocalizedString } diff --git a/src/pages/client/pages/ClientInstancePage/modals/UpdateInstanceModal/components/UpdateInstanceModalForm.tsx b/src/pages/client/pages/ClientInstancePage/modals/UpdateInstanceModal/components/UpdateInstanceModalForm.tsx index a8dba6d2..48ea334a 100644 --- a/src/pages/client/pages/ClientInstancePage/modals/UpdateInstanceModal/components/UpdateInstanceModalForm.tsx +++ b/src/pages/client/pages/ClientInstancePage/modals/UpdateInstanceModal/components/UpdateInstanceModalForm.tsx @@ -153,6 +153,20 @@ export const UpdateInstanceModalForm = () => { .catch(() => { toaster.error(LL.common.messages.error()); }); + } else { + // Device does not match used enrollment token. + toaster.error( + LL.common.messages.errorWithMessage({ + message: 'Token is not valid for this device', + }), + ); + setError( + 'token', + { + message: localLL.form.fieldErrors.token.rejected(), + }, + { shouldFocus: true }, + ); } } else { // Instance not found in client, use add instance.