mirror of
https://github.com/Radarr/Radarr
synced 2025-12-15 04:45:37 +01:00
Fixed: Redirecting after login
(cherry picked from commit 745b92daf4bf4b9562ffe52dad84a12a5561add5)
This commit is contained in:
parent
222c19e4b3
commit
d660309b5a
1 changed files with 12 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Authentication;
|
||||
using NzbDrone.Core.Configuration;
|
||||
|
||||
|
|
@ -46,7 +47,17 @@ public async Task<IActionResult> Login([FromForm] LoginResource resource, [FromQ
|
|||
|
||||
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
|
||||
|
||||
return Redirect(_configFileProvider.UrlBase + "/");
|
||||
if (returnUrl.IsNullOrWhiteSpace())
|
||||
{
|
||||
return Redirect(_configFileProvider.UrlBase + "/");
|
||||
}
|
||||
|
||||
if (_configFileProvider.UrlBase.IsNullOrWhiteSpace() || returnUrl.StartsWith(_configFileProvider.UrlBase))
|
||||
{
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
return Redirect(_configFileProvider.UrlBase + returnUrl);
|
||||
}
|
||||
|
||||
[HttpGet("logout")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue