mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-01 20:02:52 +01:00
Merge pull request #1397 from Bond-009/passfast
Streamline authentication proccess
This commit is contained in:
@@ -599,7 +599,6 @@ namespace MediaBrowser.Api.LiveTv
|
||||
{
|
||||
public bool ValidateLogin { get; set; }
|
||||
public bool ValidateListings { get; set; }
|
||||
public string Pw { get; set; }
|
||||
}
|
||||
|
||||
[Route("/LiveTv/ListingProviders", "DELETE", Summary = "Deletes a listing provider")]
|
||||
@@ -867,28 +866,10 @@ namespace MediaBrowser.Api.LiveTv
|
||||
|
||||
public async Task<object> Post(AddListingProvider request)
|
||||
{
|
||||
if (request.Pw != null)
|
||||
{
|
||||
request.Password = GetHashedString(request.Pw);
|
||||
}
|
||||
|
||||
request.Pw = null;
|
||||
|
||||
var result = await _liveTvManager.SaveListingProvider(request, request.ValidateLogin, request.ValidateListings).ConfigureAwait(false);
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hashed string.
|
||||
/// </summary>
|
||||
private string GetHashedString(string str)
|
||||
{
|
||||
// legacy
|
||||
return BitConverter.ToString(
|
||||
_cryptographyProvider.ComputeSHA1(Encoding.UTF8.GetBytes(str)))
|
||||
.Replace("-", string.Empty).ToLowerInvariant();
|
||||
}
|
||||
|
||||
public void Delete(DeleteListingProvider request)
|
||||
{
|
||||
_liveTvManager.DeleteListingsProvider(request.Id);
|
||||
|
||||
Reference in New Issue
Block a user