aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-07 12:17:39 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-07 12:17:39 -0400
commit8fc828361e6e6019bc833ffba1d5ef8fc8605ac9 (patch)
treef06929b9d9ee013a3fb49b2f53abd7a9f7e4b7bc /MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
parent31c710ca34e91a21356a19a6c1f3f6f5f3a2011f (diff)
Updated authentication
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs')
-rw-r--r--MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
index 8f6680530..9f72aa417 100644
--- a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using MediaBrowser.Common.Net.Handlers;
+using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
-using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
+using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
@@ -12,15 +9,12 @@ namespace MediaBrowser.Api.HttpHandlers
{
protected override async Task<AuthenticationResult> GetObjectToSerialize()
{
- Guid userId = Guid.Parse(await GetFormValue("userid").ConfigureAwait(false));
- User user = Kernel.Instance.Users.First(u => u.Id == userId);
+ string userId = await GetFormValue("userid").ConfigureAwait(false);
+ User user = ApiService.GetUserById(userId, false);
string password = await GetFormValue("password").ConfigureAwait(false);
- return new AuthenticationResult()
- {
- Success = Kernel.GetMD5(password).Equals(user.Password)
- };
+ return Kernel.Instance.AuthenticateUser(user, password);
}
}
}