mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Fixed exception and all areas will now use the base url #72
This commit is contained in:
parent
866b6d6d6d
commit
6dea8b7440
7 changed files with 32 additions and 16 deletions
|
@ -38,7 +38,7 @@ using PlexRequests.UI.Models;
|
|||
|
||||
namespace PlexRequests.UI.Modules
|
||||
{
|
||||
public class LoginModule : NancyModule
|
||||
public class LoginModule : BaseModule
|
||||
{
|
||||
public LoginModule()
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
};
|
||||
|
||||
Get["/logout"] = x => this.LogoutAndRedirect("~/");
|
||||
Get["/logout"] = x => this.LogoutAndRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/" : "~/");
|
||||
|
||||
Post["/login"] = x =>
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
if (userId == null)
|
||||
{
|
||||
return Context.GetRedirect("~/login?error=true&username=" + username);
|
||||
return Context.GetRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/login?error=true&username=" + username : "~/login?error=true&username=" + username);
|
||||
}
|
||||
DateTime? expiry = null;
|
||||
if (Request.Form.RememberMe.HasValue)
|
||||
|
@ -94,7 +94,7 @@ namespace PlexRequests.UI.Modules
|
|||
var exists = UserMapper.DoUsersExist();
|
||||
if (exists)
|
||||
{
|
||||
return Context.GetRedirect("~/register?error=true");
|
||||
return Context.GetRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/register?error=true" : "~/register?error=true");
|
||||
}
|
||||
var userId = UserMapper.CreateUser(username, Request.Form.Password, new[] { "Admin" });
|
||||
Session[SessionKeys.UsernameKey] = username;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue