From 98a1b0da711ed90797008d83f2371791b96f2696 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Thu, 28 Jan 2021 10:08:22 +0100 Subject: [PATCH] Update public account URLs - /Account/Login -> /login - /Account/Register -> /register - /Account/ForgotPassword -> /forgot-password --- BTCPayServer.Tests/SeleniumTester.cs | 4 ++-- BTCPayServer.Tests/SeleniumTests.cs | 4 +--- BTCPayServer/Controllers/AccountController.cs | 7 +++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index e34f43dca..f981aa59c 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -85,7 +85,7 @@ namespace BTCPayServer.Tests public void GoToRegister() { - Driver.Navigate().GoToUrl(Link("/Account/Register")); + Driver.Navigate().GoToUrl(Link("/register")); } public string RegisterNewUser(bool isAdmin = false) @@ -285,7 +285,7 @@ namespace BTCPayServer.Tests public void GoToLogin() { - Driver.Navigate().GoToUrl(new Uri(Server.PayTester.ServerUri, "Account/Login")); + Driver.Navigate().GoToUrl(new Uri(Server.PayTester.ServerUri, "/login")); } public string CreateInvoice(string storeName, decimal amount = 100, string currency = "USD", string refundEmail = "") diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 4ed8668ab..2235a9fcb 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -97,9 +97,7 @@ namespace BTCPayServer.Tests var email = s.RegisterNewUser(); s.Logout(); s.Driver.AssertNoError(); - Assert.Contains("Account/Login", s.Driver.Url); - // Should show the Tor address - Assert.Contains("wsaxew3qa5ljfuenfebmaf3m5ykgatct3p6zjrqwoouj3foererde3id.onion", s.Driver.PageSource); + Assert.Contains("/login", s.Driver.Url); s.Driver.Navigate().GoToUrl(s.Link("/invoices")); Assert.Contains("ReturnUrl=%2Finvoices", s.Driver.Url); diff --git a/BTCPayServer/Controllers/AccountController.cs b/BTCPayServer/Controllers/AccountController.cs index 0e74e30e3..1665212c2 100644 --- a/BTCPayServer/Controllers/AccountController.cs +++ b/BTCPayServer/Controllers/AccountController.cs @@ -66,6 +66,7 @@ namespace BTCPayServer.Controllers [HttpGet] [AllowAnonymous] + [Route("/login")] public async Task Login(string returnUrl = null, string email = null) { @@ -89,6 +90,7 @@ namespace BTCPayServer.Controllers [HttpPost] [AllowAnonymous] + [Route("/login")] [ValidateAntiForgeryToken] [RateLimitsFilter(ZoneLimits.Login, Scope = RateLimitsScope.RemoteAddress)] public async Task Login(LoginViewModel model, string returnUrl = null) @@ -396,6 +398,7 @@ namespace BTCPayServer.Controllers [HttpGet] [AllowAnonymous] + [Route("/register")] [RateLimitsFilter(ZoneLimits.Register, Scope = RateLimitsScope.RemoteAddress)] public async Task Register(string returnUrl = null, bool logon = true) { @@ -413,6 +416,7 @@ namespace BTCPayServer.Controllers [HttpPost] [AllowAnonymous] + [Route("/register")] [ValidateAntiForgeryToken] public async Task Register(RegisterViewModel model, string returnUrl = null, bool logon = true) { @@ -479,6 +483,7 @@ namespace BTCPayServer.Controllers public bool RegisteredAdmin { get; set; } [HttpGet] + [Route("/logout")] public async Task Logout() { await _signInManager.SignOutAsync(); @@ -527,6 +532,7 @@ namespace BTCPayServer.Controllers [HttpGet] [AllowAnonymous] + [Route("/forgot-password")] public IActionResult ForgotPassword() { return View(); @@ -534,6 +540,7 @@ namespace BTCPayServer.Controllers [HttpPost] [AllowAnonymous] + [Route("/forgot-password")] [ValidateAntiForgeryToken] public async Task ForgotPassword(ForgotPasswordViewModel model) {