From c631b682662a614fa489164c5488adbf4a8530ae Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Tue, 22 Jun 2021 22:45:34 +0800 Subject: [PATCH] Add hint to sign in with 2FA enabled --- lib/l10n/app_en.arb | 4 ++++ lib/widget/sign_in.dart | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index b490b1f3..cba2e538 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -245,6 +245,10 @@ "@signInHeaderText": { "description": "Inform user what to do in sign in widget" }, + "signIn2faHintText": "*Use an app password if you have two-factor authentication enabled in the server", + "@signIn2faHintText": { + "description": "Notify users with 2FA enabled what should be done in order to sign in correctly" + }, "serverAddressInputHint": "Sever address", "@serverAddressInputHint": { "description": "Hint of the text field expecting server address data" diff --git a/lib/widget/sign_in.dart b/lib/widget/sign_in.dart index e58364e0..483c9645 100644 --- a/lib/widget/sign_in.dart +++ b/lib/widget/sign_in.dart @@ -63,6 +63,17 @@ class _SignInState extends State { child: _buildForm(context), ), ), + Container( + alignment: AlignmentDirectional.centerStart, + constraints: const BoxConstraints( + maxWidth: AppTheme.widthLimitedContentMaxWidth), + padding: const EdgeInsets.symmetric( + horizontal: 32, vertical: 16), + child: Text( + AppLocalizations.of(context).signIn2faHintText, + style: TextStyle(fontStyle: FontStyle.italic), + ), + ), if (!platform_k.isWeb) Expanded(child: Container()), Container( constraints: const BoxConstraints(