mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 19:08:27 +01:00
Added User authentication
This commit is contained in:
parent
a529f07869
commit
3538789e46
28
MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
Normal file
28
MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Net.Handlers;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.DTO;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Api.HttpHandlers
|
||||
{
|
||||
class UserAuthenticationHandler : BaseSerializationHandler<AuthenticationResult>
|
||||
{
|
||||
protected override async Task<AuthenticationResult> GetObjectToSerialize()
|
||||
{
|
||||
Guid userId = Guid.Parse(QueryString["userid"]);
|
||||
User user = Kernel.Instance.Users.First(u => u.Id == userId);
|
||||
|
||||
string password = await GetFormValue("password").ConfigureAwait(false);
|
||||
|
||||
AuthenticationResult result = new AuthenticationResult()
|
||||
{
|
||||
Success = true
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user