Add comment

This commit is contained in:
Patrick Barron 2020-06-13 19:30:45 -04:00
parent 6f325fea61
commit e8f8307521

View File

@ -20,7 +20,6 @@ using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Cryptography; using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events; using MediaBrowser.Model.Events;
using MediaBrowser.Model.Users; using MediaBrowser.Model.Users;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -618,6 +617,8 @@ namespace Jellyfin.Server.Implementations.Users
{ {
var dbContext = _dbProvider.CreateContext(); var dbContext = _dbProvider.CreateContext();
var user = dbContext.Users.Find(userId) ?? throw new ArgumentException("No user exists with given Id!"); var user = dbContext.Users.Find(userId) ?? throw new ArgumentException("No user exists with given Id!");
// The default number of login attempts is 3, but for some god forsaken reason it's sent to the server as "0"
int? maxLoginAttempts = policy.LoginAttemptsBeforeLockout switch int? maxLoginAttempts = policy.LoginAttemptsBeforeLockout switch
{ {
-1 => null, -1 => null,