mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-06 15:44:26 +01:00
Do not redirect from login page if there is a returnUrl.
This commit is contained in:
@@ -73,8 +73,8 @@ namespace BTCPayServer.Controllers
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IActionResult> Login(string returnUrl = null)
|
public async Task<IActionResult> Login(string returnUrl = null)
|
||||||
{
|
{
|
||||||
if (User.Identity.IsAuthenticated)
|
if (User.Identity.IsAuthenticated && string.IsNullOrEmpty(returnUrl))
|
||||||
return RedirectToLocal(returnUrl);
|
return RedirectToLocal();
|
||||||
// Clear the existing external cookie to ensure a clean login process
|
// Clear the existing external cookie to ensure a clean login process
|
||||||
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
|
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IActionResult RedirectToLocal(string returnUrl)
|
private IActionResult RedirectToLocal(string returnUrl = null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl))
|
if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user