diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index d214abb64..4145dba4f 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -664,6 +664,7 @@ namespace BTCPayServer.Tests Assert.Equal(parsedBip21.Address.ToString(), s.Driver.FindElement(By.Id($"Outputs_0__DestinationAddress")).GetAttribute("value")); s.GoToWallet(new WalletId(storeId.storeId, "BTC"), WalletsNavPages.Settings); + var walletUrl = s.Driver.Url; s.Driver.FindElement(By.Id("SettingsMenu")).ForceClick(); s.Driver.FindElement(By.CssSelector("button[value=view-seed]")).Click(); @@ -671,7 +672,12 @@ namespace BTCPayServer.Tests // Seed backup page var recoveryPhrase = s.Driver.FindElements(By.Id("recovery-phrase")).First().GetAttribute("data-mnemonic"); Assert.Equal(mnemonic.ToString(), recoveryPhrase); - Assert.Contains("The recovery phrase will also be stored on a server as a hot wallet.", s.Driver.PageSource); + Assert.Contains("The recovery phrase will also be stored on the server as a hot wallet.", s.Driver.PageSource); + + // No confirmation, just a link to return to the wallet + Assert.Empty(s.Driver.FindElements(By.Id("confirm"))); + s.Driver.FindElement(By.Id("proceed")).Click(); + Assert.Equal(walletUrl, s.Driver.Url); } } void SetTransactionOutput(SeleniumTester s, int index, BitcoinAddress dest, decimal amount, bool subtract = false) diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs index 5d73f04c4..b165add39 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/WalletsController.cs @@ -1160,6 +1160,7 @@ namespace BTCPayServer.Controllers CryptoCode = walletId.CryptoCode, Mnemonic = seed, IsStored = true, + RequireConfirm = false, ReturnUrl = Url.Action(nameof(WalletSettings), new { walletId }) }; return this.RedirectToRecoverySeedBackup(recoveryVm); diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index eb4ad0f44..0eff102dc 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -445,6 +445,7 @@ namespace BTCPayServer new KeyValuePair("mnemonic", vm.Mnemonic), new KeyValuePair("passphrase", vm.Passphrase), new KeyValuePair("isStored", vm.IsStored ? "true" : "false"), + new KeyValuePair("requireConfirm", vm.RequireConfirm ? "true" : "false"), new KeyValuePair("returnUrl", vm.ReturnUrl) } }; diff --git a/BTCPayServer/Models/StoreViewModels/RecoverySeedBackupViewModel.cs b/BTCPayServer/Models/StoreViewModels/RecoverySeedBackupViewModel.cs index 265d37f27..a00c7a20f 100644 --- a/BTCPayServer/Models/StoreViewModels/RecoverySeedBackupViewModel.cs +++ b/BTCPayServer/Models/StoreViewModels/RecoverySeedBackupViewModel.cs @@ -10,8 +10,9 @@ namespace BTCPayServer.Models.StoreViewModels public string CryptoCode { get; set; } public string Mnemonic { get; set; } public string Passphrase { get; set; } - public bool IsStored { get; set; } public string ReturnUrl { get; set; } + public bool IsStored { get; set; } + public bool RequireConfirm { get; set; } = true; public string[] Words { diff --git a/BTCPayServer/Views/Home/RecoverySeedBackup.cshtml b/BTCPayServer/Views/Home/RecoverySeedBackup.cshtml index 519a3e53f..f9f12af33 100644 --- a/BTCPayServer/Views/Home/RecoverySeedBackup.cshtml +++ b/BTCPayServer/Views/Home/RecoverySeedBackup.cshtml @@ -46,7 +46,7 @@ Do not photograph it. Do not store it digitally.

- The recovery phrase will also be stored on a server as a hot wallet. + The recovery phrase will also be stored on the server as a hot wallet.

} else @@ -65,11 +65,18 @@

Please make sure to also write down your passphrase.

} -
- - - - -
+ @if (Model.RequireConfirm) + { +
+ + + + +
+ } + else + { + Done + }