mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 16:52:04 +02:00
Fixed: Forms login with urlbase
This commit is contained in:
@@ -14,10 +14,12 @@ namespace Prowlarr.Http.Authentication
|
|||||||
public class AuthenticationController : Controller
|
public class AuthenticationController : Controller
|
||||||
{
|
{
|
||||||
private readonly IAuthenticationService _authService;
|
private readonly IAuthenticationService _authService;
|
||||||
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
|
|
||||||
public AuthenticationController(IAuthenticationService authService)
|
public AuthenticationController(IAuthenticationService authService, IConfigFileProvider configFileProvider)
|
||||||
{
|
{
|
||||||
_authService = authService;
|
_authService = authService;
|
||||||
|
_configFileProvider = configFileProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("login")]
|
[HttpPost("login")]
|
||||||
@@ -44,7 +46,7 @@ namespace Prowlarr.Http.Authentication
|
|||||||
|
|
||||||
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
|
await HttpContext.SignInAsync(AuthenticationType.Forms.ToString(), new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "identifier")), authProperties);
|
||||||
|
|
||||||
return Redirect("/");
|
return Redirect(_configFileProvider.UrlBase + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("logout")]
|
[HttpGet("logout")]
|
||||||
@@ -52,7 +54,7 @@ namespace Prowlarr.Http.Authentication
|
|||||||
{
|
{
|
||||||
_authService.Logout(HttpContext);
|
_authService.Logout(HttpContext);
|
||||||
await HttpContext.SignOutAsync(AuthenticationType.Forms.ToString());
|
await HttpContext.SignOutAsync(AuthenticationType.Forms.ToString());
|
||||||
return Redirect("/");
|
return Redirect(_configFileProvider.UrlBase + "/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user