mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 00:06:05 -07:00
Redirect to search if we are already logged in #488
This commit is contained in:
parent
265d1bdd25
commit
0fe7bba9ac
1 changed files with 11 additions and 7 deletions
|
@ -61,7 +61,17 @@ namespace PlexRequests.UI.Modules
|
||||||
PlexSettings = plexSettings;
|
PlexSettings = plexSettings;
|
||||||
Linker = linker;
|
Linker = linker;
|
||||||
|
|
||||||
Get["UserLoginIndex", "/", true] = async (x, ct) => await Index();
|
Get["UserLoginIndex", "/", true] = async (x, ct) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Username) || IsAdmin)
|
||||||
|
{
|
||||||
|
var uri = Linker.BuildAbsoluteUri(Context, "SearchIndex");
|
||||||
|
return Response.AsRedirect(uri.ToString());
|
||||||
|
}
|
||||||
|
var settings = await AuthService.GetSettingsAsync();
|
||||||
|
return View["Index", settings];
|
||||||
|
};
|
||||||
|
|
||||||
Post["/", true] = async (x, ct) => await LoginUser();
|
Post["/", true] = async (x, ct) => await LoginUser();
|
||||||
Get["/logout"] = x => Logout();
|
Get["/logout"] = x => Logout();
|
||||||
}
|
}
|
||||||
|
@ -75,12 +85,6 @@ namespace PlexRequests.UI.Modules
|
||||||
|
|
||||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
public async Task<Negotiator> Index()
|
|
||||||
{
|
|
||||||
var settings = await AuthService.GetSettingsAsync();
|
|
||||||
return View["Index", settings];
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<Response> LoginUser()
|
private async Task<Response> LoginUser()
|
||||||
{
|
{
|
||||||
var dateTimeOffset = Request.Form.DateTimeOffset;
|
var dateTimeOffset = Request.Form.DateTimeOffset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue