From aa49358b9776acf7c92933dee9f5d57255d61f39 Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 21 Oct 2021 21:04:26 +0100 Subject: [PATCH] Fixed: Forms login with urlbase (cherry picked from commit 811a9d4c6123643e0a2ae26c1ccf06717cb5f47b) (cherry picked from commit a8c91f2bc819f570f8e07e489ba53b12a22ae0e6) (cherry picked from commit 222b56e7bc38feb2a94ba0762e7120d6f75c2a8a) --- .../Authentication/AuthenticationController.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Radarr.Http/Authentication/AuthenticationController.cs b/src/Radarr.Http/Authentication/AuthenticationController.cs index 400091b99..e796f92f4 100644 --- a/src/Radarr.Http/Authentication/AuthenticationController.cs +++ b/src/Radarr.Http/Authentication/AuthenticationController.cs @@ -14,10 +14,12 @@ namespace Radarr.Http.Authentication public class AuthenticationController : Controller { private readonly IAuthenticationService _authService; + private readonly IConfigFileProvider _configFileProvider; - public AuthenticationController(IAuthenticationService authService) + public AuthenticationController(IAuthenticationService authService, IConfigFileProvider configFileProvider) { _authService = authService; + _configFileProvider = configFileProvider; } [HttpPost("login")] @@ -44,7 +46,7 @@ namespace Radarr.Http.Authentication await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties); - return Redirect("/"); + return Redirect(_configFileProvider.UrlBase + "/"); } [HttpGet("logout")] @@ -52,7 +54,7 @@ namespace Radarr.Http.Authentication { _authService.Logout(HttpContext); await HttpContext.SignOutAsync(AuthenticationType.Forms.ToString()); - return Redirect("/"); + return Redirect(_configFileProvider.UrlBase + "/"); } } }