1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-07-15 00:57:36 +02:00

Fixed: Forms login page uses urlbase for logo

(cherry picked from commit e0f30c3eaeab7d863b4b4104a9f0d501bd693f69)
(cherry picked from commit 73f81465e9e38ea545155b4ec98b23ddb9bc4816)
(cherry picked from commit 0332356fa34a893bc856d39e280f70681ffbc822)
This commit is contained in:
ta264 2021-10-21 21:04:26 +01:00 committed by Qstick
parent aa49358b97
commit ee84321d4b

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
@ -16,29 +15,21 @@ namespace Radarr.Http.Frontend
[ApiController]
public class StaticResourceController : Controller
{
private readonly string _urlBase;
private readonly string _loginPath;
private readonly IEnumerable<IMapHttpRequestsToDisk> _requestMappers;
private readonly Logger _logger;
public StaticResourceController(IConfigFileProvider configFileProvider,
IAppFolderInfo appFolderInfo,
IEnumerable<IMapHttpRequestsToDisk> requestMappers,
public StaticResourceController(IEnumerable<IMapHttpRequestsToDisk> requestMappers,
Logger logger)
{
_urlBase = configFileProvider.UrlBase.Trim('/');
_requestMappers = requestMappers;
_logger = logger;
_loginPath = Path.Combine(appFolderInfo.StartUpFolder, configFileProvider.UiFolder, "login.html");
}
[AllowAnonymous]
[HttpGet("login")]
public IActionResult LoginPage()
{
Response.Headers.DisableCache();
return PhysicalFile(_loginPath, "text/html");
return MapResource("login");
}
[EnableCors("AllowGet")]