1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 03:15:19 +00:00

Fixed: Username must not be null or empty when logging in

This commit is contained in:
Mark McDowall 2015-12-27 00:59:28 -08:00
parent cfe121c777
commit 8dcd8d17b5

View file

@ -3,6 +3,7 @@
using Nancy.Authentication.Forms;
using Nancy.Extensions;
using Nancy.ModelBinding;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration;
@ -23,6 +24,11 @@ public AuthenticationModule(IUserService userService, IConfigFileProvider config
private Response Login(LoginResource resource)
{
Ensure.That(resource.Username, () => resource.Username).IsNotNullOrWhiteSpace();
// TODO: A null or empty password should not be allowed, uncomment in v3
//Ensure.That(resource.Password, () => resource.Password).IsNotNullOrWhiteSpace();
var user = _userService.FindUser(resource.Username, resource.Password);
if (user == null)