This commit is contained in:
Serhii 2023-11-23 19:33:21 +02:00
parent b87c11bbe4
commit 7fe1091b4c
4 changed files with 57 additions and 43 deletions

View file

@ -30,9 +30,6 @@ class WarningPage extends BasePage {
Widget body(BuildContext context) {
final image = currentTheme.type == ThemeType.dark ? imageDark : imageLight;
final text =
"Cake 2FA is a second authentication for certain actions in the wallet. It is NOT as secure as cold storage. If you lose access to your 2FA app or passkeys, you WILL lose access to this wallet. You will need to restore your wallet from the mnemonic seed. Cake support will be unable to assist you if you lose access to your 2FA or mnemonic seeds. Before using Cake 2FA, we recommend reading through the guide here.";
return WillPopScope(
onWillPop: () async => false,
child: Container(
@ -44,29 +41,35 @@ class WarningPage extends BasePage {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
ConstrainedBox(
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
child: AspectRatio(aspectRatio: 1, child: image),
Expanded(
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
child: AspectRatio(aspectRatio: 1, child: image),
),
),
Padding(
padding: EdgeInsets.all(10),
child: Text(
isPreSeedPage
? S.of(context).pre_seed_description(seedPhraseLength.toString())
: text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: isPreSeedPage
? Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor
: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
Expanded(
child: Padding(
padding: EdgeInsets.all(10),
child: Text(
isPreSeedPage
? S.of(context).pre_seed_description(seedPhraseLength.toString())
: S.of(context).setup_warning_2fa_text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: isPreSeedPage
? Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor
: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
),
),
PrimaryButton(
onPressed: () => isPreSeedPage
? Navigator.of(context).popAndPushNamed(Routes.seed, arguments: true)
: Navigator.of(context).popAndPushNamed(Routes.setup_2faPage),
text: isPreSeedPage ? S.of(context).pre_seed_button_text : 'Neeeeeeee',
text: isPreSeedPage
? S.of(context).pre_seed_button_text
: S.of(context).understand,
color: Theme.of(context).primaryColor,
textColor: Colors.white)
],

View file

@ -14,23 +14,27 @@ class Setup2FAPage extends BasePage {
final Setup2FAViewModel setup2FAViewModel;
@override
String get title => S.current.setup_2fa;
String get title => 'CAKE 2FA';
@override
Widget body(BuildContext context) {
final cake2FAGuideTitle = 'Cake 2FA Guide';
final cake2FAGuideUri =
Uri.parse('https://guides.cakewallet.com/docs/advanced-features/authentication');
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ConstrainedBox(
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 2,
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
child:
AspectRatio(aspectRatio: 1, child: Image.asset('assets/images/setup_2fa_img.png')),
),
Padding(
),
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
child: Text(
S.current.setup_2fa_text,
@ -43,20 +47,25 @@ class Setup2FAPage extends BasePage {
),
),
),
SizedBox(height: 56),
SettingsCellWithArrow(
title: S.current.setup_totp_recommended,
handler: (_) {
setup2FAViewModel.generateSecretKey();
return Navigator.of(context).pushReplacementNamed(Routes.setup_2faQRPage);
},
),
Expanded(
child: Column(
children: [
SettingsCellWithArrow(
title: S.current.setup_totp_recommended,
handler: (_) {
setup2FAViewModel.generateSecretKey();
return Navigator.of(context).pushReplacementNamed(Routes.setup_2faQRPage);
},
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SettingsCellWithArrow(
title: cake2FAGuideTitle, handler: (_) => _launchUrl(cake2FAGuideUri)),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
],
),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SettingsCellWithArrow(
title: cake2FAGuideTitle, handler: (_) => _launchUrl(cake2FAGuideUri)),
StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
],
),
),
],
);
}

View file

@ -36,7 +36,7 @@ class Setup2FAQRPage extends BasePage {
children: [
Spacer(),
Text(
S.current.add_secret_code,
S.current.scan_qr_on_device,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,

View file

@ -626,9 +626,11 @@
"totp_verification_success": "Verification Successful!",
"totp_2fa_failure": "Incorrect code. Please try a different code or generate a new secret key. Use a compatible 2FA app that supports 8-digit codes and SHA512.",
"enter_totp_code": "Please enter the TOTP Code.",
"add_secret_code": "Add this secret code to another device",
"scan_qr_on_device": "Scan this QR code on another device",
"add_secret_code": "Or, add this secret code to an authenticator app",
"totp_secret_code": "TOTP Secret Code",
"setup_2fa_text": "Cake 2FA is NOT as secure as cold storage. 2FA protects against basic types of attacks, such as your friend providing your fingerprint while you are sleeping.\n\n Cake 2FA does NOT protect against a compromised device by a sophisticated attacker.\n\n If you lose access to your 2FA codes, YOU WILL LOSE ACCESS TO THIS WALLET. You will need to restore your wallet from mnemonic seed. YOU MUST THEREFORE BACK UP YOUR MNEMONIC SEEDS! Further, someone with access to your mnemonic seed(s) will be able to steal your funds, bypassing Cake 2FA.\n\n Cake support staff will be unable to assist you if you lose access to your mnemonic seed, since Cake is a noncustodial wallet.",
"setup_2fa_text": "Cake 2FA works through TOTP as the second authentication factor.\n\nCake 2FA's TOTP requires SHA-512 and 8 digit support; this provides increased security. More information and supported apps can be found in the guide here.",
"setup_warning_2fa_text": "Cake 2FA is a second authentication for certain actions in the wallet. It is NOT as secure as cold storage.\n If you lose access to your 2FA app or passkeys, you WILL lose access to this wallet.\n You will need to restore your wallet from the mnemonic seed.\n Cake support will be unable to assist you if you lose access to your 2FA or mnemonic seeds. Before using Cake 2FA, we recommend reading through the guide.",
"setup_totp_recommended": "Set up TOTP (Recommended)",
"disable_buy": "Disable buy action",
"disable_sell": "Disable sell action",