jellyfin/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti 8fc828361e Updated authentication
2012-09-07 12:17:39 -04:00

21 lines
702 B
C#

using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.Entities;
using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
class UserAuthenticationHandler : BaseSerializationHandler<AuthenticationResult>
{
protected override async Task<AuthenticationResult> GetObjectToSerialize()
{
string userId = await GetFormValue("userid").ConfigureAwait(false);
User user = ApiService.GetUserById(userId, false);
string password = await GetFormValue("password").ConfigureAwait(false);
return Kernel.Instance.AuthenticateUser(user, password);
}
}
}