mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
fixed #412
This commit is contained in:
parent
5bda83bfdf
commit
8854dc23c7
4 changed files with 279 additions and 277 deletions
|
@ -55,7 +55,7 @@ namespace PlexRequests.UI.Modules
|
|||
LandingPageSettings = lp;
|
||||
Analytics = a;
|
||||
Api = api;
|
||||
Get["/", true] = async (x, ct) => await Index();
|
||||
Get["UserLoginIndex","/", true] = async (x, ct) => await Index();
|
||||
Post["/"] = x => LoginUser();
|
||||
Get["/logout"] = x => Logout();
|
||||
}
|
||||
|
@ -69,42 +69,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
public async Task<Negotiator> Index()
|
||||
{
|
||||
var query = Request.Query["landing"];
|
||||
var landingCheck = (bool?)query ?? true;
|
||||
if (landingCheck)
|
||||
{
|
||||
var landingSettings = await LandingPageSettings.GetSettingsAsync();
|
||||
|
||||
if (landingSettings.Enabled)
|
||||
{
|
||||
|
||||
if (landingSettings.BeforeLogin)
|
||||
{
|
||||
#pragma warning disable 4014
|
||||
Analytics.TrackEventAsync(
|
||||
#pragma warning restore 4014
|
||||
Category.LandingPage,
|
||||
Action.View,
|
||||
"Going To LandingPage before login",
|
||||
Username,
|
||||
CookieHelper.GetAnalyticClientId(Cookies));
|
||||
|
||||
var model = new LandingPageViewModel
|
||||
{
|
||||
Enabled = landingSettings.Enabled,
|
||||
Id = landingSettings.Id,
|
||||
EnabledNoticeTime = landingSettings.EnabledNoticeTime,
|
||||
NoticeEnable = landingSettings.NoticeEnable,
|
||||
NoticeEnd = landingSettings.NoticeEnd,
|
||||
NoticeMessage = landingSettings.NoticeMessage,
|
||||
NoticeStart = landingSettings.NoticeStart,
|
||||
ContinueUrl = landingSettings.BeforeLogin ? $"userlogin" : $"search"
|
||||
};
|
||||
|
||||
return View["Landing/Index", model];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var settings = await AuthService.GetSettingsAsync();
|
||||
return View["Index", settings];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue