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