mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-13 18:24:16 +01:00
minor refactoring
This commit is contained in:
parent
6c243d0247
commit
f9e4fd4f2d
38 changed files with 1391 additions and 854 deletions
|
|
@ -0,0 +1,24 @@
|
|||
namespace MareSynchronosServices.Authentication;
|
||||
|
||||
public class FailedAuthorization : IDisposable
|
||||
{
|
||||
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