mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-15 17:24:14 +01:00
adjust authentication handler
This commit is contained in:
parent
efec37db34
commit
2a1b04214b
2 changed files with 62 additions and 114 deletions
|
|
@ -4,23 +4,11 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace MareSynchronosServices.Authentication;
|
||||
|
||||
internal class FailedAuthorization : IDisposable
|
||||
internal class FailedAuthorization
|
||||
{
|
||||
private int failedAttempts = 1;
|
||||
public int FailedAttempts => failedAttempts;
|
||||
public Task ResetTask { get; set; }
|
||||
public CancellationTokenSource? ResetCts { get; set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
ResetCts?.Cancel();
|
||||
ResetCts?.Dispose();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void IncreaseFailedAttempts()
|
||||
{
|
||||
Interlocked.Increment(ref failedAttempts);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue