mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-02-28 04:49:08 -05:00
Refactor (#192)
This commit is contained in:
committed by
Leendert de Borst
parent
c85bf5cebd
commit
9d0fc082c0
@@ -248,7 +248,7 @@ public class AuthController(IDbContextFactory<AliasServerDbContext> dbContextFac
|
||||
}
|
||||
|
||||
// Check if the refresh token is valid.
|
||||
var existingToken = context.AliasVaultUserRefreshTokens.FirstOrDefault(t => t.UserId == user.Id && t.Value == tokenModel.RefreshToken);
|
||||
var existingToken = await context.AliasVaultUserRefreshTokens.FirstOrDefaultAsync(t => t.UserId == user.Id && t.Value == tokenModel.RefreshToken);
|
||||
if (existingToken == null || existingToken.ExpireDate < timeProvider.UtcNow)
|
||||
{
|
||||
await authLoggingService.LogAuthEventFailAsync(user.UserName!, AuthEventType.TokenRefresh, AuthFailureReason.InvalidRefreshToken);
|
||||
@@ -536,8 +536,6 @@ public class AuthController(IDbContextFactory<AliasServerDbContext> dbContextFac
|
||||
{
|
||||
await using var context = await dbContextFactory.CreateDbContextAsync();
|
||||
|
||||
var accessToken = GenerateJwtToken(user);
|
||||
|
||||
await _semaphore.WaitAsync();
|
||||
try
|
||||
{
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
// </copyright>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
// Run tests in parallel with a maximum of 2 parallel tests.
|
||||
// Run tests in parallel with a maximum of 1 parallel tests (= not parallel).
|
||||
// Increasing the level of parallelism can lead to concurrency issues especially
|
||||
// when running tests through GitHub Actions where the retry will take
|
||||
// longer to complete as opposed to running just one test at a time.
|
||||
[assembly: LevelOfParallelism(1)]
|
||||
|
||||
namespace AliasVault.E2ETests.Common;
|
||||
|
||||
@@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Http;
|
||||
/// <summary>
|
||||
/// Ip address utility class to extract IP address from HttpContext.
|
||||
/// </summary>
|
||||
public class IpAddressUtility
|
||||
public static class IpAddressUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// Extract IP address from HttpContext.
|
||||
|
||||
Reference in New Issue
Block a user