This commit is contained in:
Leendert de Borst
2024-09-14 21:05:37 +02:00
committed by Leendert de Borst
parent c85bf5cebd
commit 9d0fc082c0
3 changed files with 6 additions and 5 deletions

View File

@@ -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
{

View File

@@ -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;

View File

@@ -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.