mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Forms login with urlbase
(cherry picked from commit 811a9d4c6123643e0a2ae26c1ccf06717cb5f47b) (cherry picked from commit a8c91f2bc819f570f8e07e489ba53b12a22ae0e6)
This commit is contained in:
parent
5b2affcabb
commit
222b56e7bc
1 changed files with 5 additions and 3 deletions
|
@ -14,10 +14,12 @@ namespace Lidarr.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 Lidarr.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 Lidarr.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 + "/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue