Update public account URLs

- /Account/Login -> /login
- /Account/Register -> /register
- /Account/ForgotPassword -> /forgot-password
This commit is contained in:
Dennis Reimann 2021-01-28 10:08:22 +01:00
parent 074ff76d49
commit 98a1b0da71
No known key found for this signature in database
GPG Key ID: 5009E1797F03F8D0
3 changed files with 10 additions and 5 deletions

View File

@ -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 = "")

View File

@ -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);

View File

@ -66,6 +66,7 @@ namespace BTCPayServer.Controllers
[HttpGet]
[AllowAnonymous]
[Route("/login")]
public async Task<IActionResult> 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<IActionResult> 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<IActionResult> Register(string returnUrl = null, bool logon = true)
{
@ -413,6 +416,7 @@ namespace BTCPayServer.Controllers
[HttpPost]
[AllowAnonymous]
[Route("/register")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> 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<IActionResult> 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<IActionResult> ForgotPassword(ForgotPasswordViewModel model)
{