mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
When logged in, the URL /account/login is still accessible (Fix https://github.com/btcpayserver/btcpayserver/issues/916)
This commit is contained in:
parent
ae73858e23
commit
fd4a27c1a3
@ -73,6 +73,8 @@ namespace BTCPayServer.Controllers
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> Login(string returnUrl = null)
|
||||
{
|
||||
if (User.Identity.IsAuthenticated)
|
||||
RedirectToLocal(returnUrl);
|
||||
// Clear the existing external cookie to ensure a clean login process
|
||||
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
|
||||
|
||||
@ -647,7 +649,7 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
private IActionResult RedirectToLocal(string returnUrl)
|
||||
{
|
||||
if (Url.IsLocalUrl(returnUrl))
|
||||
if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl))
|
||||
{
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user