{response.Mnemonic}"
+ Html = $"Your wallet has been generated. Please store your seed securely!"
});
+ var vm = new RecoverySeedBackupViewModel()
+ {
+ CryptoCode = cryptoCode,
+ Mnemonic = response.Mnemonic,
+ Passphrase = response.Passphrase,
+ IsStored = request.SavePrivateKeys,
+ ReturnUrl = Url.Action(nameof(UpdateStore), new { storeId })
+ };
+ return this.RedirectToRecoverySeedBackup(vm);
}
else
{
diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs
index 8eed1b862..5774f3a40 100644
--- a/BTCPayServer/Controllers/WalletsController.cs
+++ b/BTCPayServer/Controllers/WalletsController.cs
@@ -9,6 +9,7 @@ using BTCPayServer.Data;
using BTCPayServer.HostedServices;
using BTCPayServer.ModelBinders;
using BTCPayServer.Models;
+using BTCPayServer.Models.StoreViewModels;
using BTCPayServer.Models.WalletViewModels;
using BTCPayServer.Payments;
using BTCPayServer.Security;
@@ -1147,8 +1148,16 @@ namespace BTCPayServer.Controllers
TempData.SetStatusMessageModel(new StatusMessageModel()
{
Severity = StatusMessageModel.StatusSeverity.Success,
- Html = $"Please store your seed securely! {seed}"
+ Html = $"Please store your seed securely!"
});
+ var recoveryVm = new RecoverySeedBackupViewModel()
+ {
+ CryptoCode = walletId.CryptoCode,
+ Mnemonic = seed,
+ IsStored = true,
+ ReturnUrl = Url.Action(nameof(WalletSettings), new { walletId })
+ };
+ return this.RedirectToRecoverySeedBackup(recoveryVm);
}
return RedirectToAction(nameof(WalletSettings));
diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs
index dab1efc7f..52f4b54d5 100644
--- a/BTCPayServer/Extensions.cs
+++ b/BTCPayServer/Extensions.cs
@@ -12,12 +12,14 @@ using BTCPayServer.Configuration;
using BTCPayServer.Data;
using BTCPayServer.Lightning;
using BTCPayServer.Models;
+using BTCPayServer.Models.StoreViewModels;
using BTCPayServer.Payments;
using BTCPayServer.Payments.Bitcoin;
using BTCPayServer.Services;
using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Wallets;
using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -429,5 +431,23 @@ namespace BTCPayServer
{
ctx.Items["BTCPAY.STORESDATA"] = storeData;
}
+
+ public static IActionResult RedirectToRecoverySeedBackup(this Controller controller, RecoverySeedBackupViewModel vm)
+ {
+ var redirectVm = new PostRedirectViewModel()
+ {
+ AspController = "Home",
+ AspAction = "RecoverySeedBackup",
+ Parameters =
+ {
+ new KeyValuePair+ The words below are called your recovery phrase. + Please save these words securely. + They will allow you to recover your wallet. +
+ @if (!Model.IsStored) + { +The recovery phrase will only be shown before being wiped from the server.
+ } ++ Do not photograph or store this in a non air-gapped digital format. + Anyone with access to your recovery phrase can steal your funds. +
+ @if (!string.IsNullOrEmpty(Model.Passphrase)) + { +Please make also sure to store your passphrase.
+ } +