Fixed the login issue and pass Radarr the year #990

This commit is contained in:
Jamie.Rees 2017-01-25 14:41:04 +00:00
parent 3d2209d163
commit a1fb4018b5
5 changed files with 13 additions and 8 deletions

View file

@ -31,6 +31,7 @@ using System.Linq;
using System.Threading;
using Nancy;
using Nancy.Security;
using NLog;
using Ombi.Core;
using Ombi.Core.SettingModels;
using Ombi.Helpers;
@ -100,6 +101,7 @@ namespace Ombi.UI.Modules
}
private static Logger Log = LogManager.GetCurrentClassLogger();
private string _username;
/// <summary>
/// Returns the Username or UserAlias
@ -112,16 +114,17 @@ namespace Ombi.UI.Modules
{
try
{
var username = Security.GetUsername(User.UserName, Session);
var username = Security.GetUsername(User?.UserName, Session);
if (string.IsNullOrEmpty(username))
{
return "Unknown User";
return string.Empty;
}
_username = username;
}
catch (Exception)
catch (Exception e)
{
return "Unknown User Error";
Log.Info(e);
return string.Empty;
}
}
return _username;