mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
fixed tests and adding new sessions when it not needed
This commit is contained in:
@@ -38,14 +38,14 @@ public class UserSessionOpener : IUserSessionOpener
|
||||
try
|
||||
{
|
||||
var sessions = await _repository.GetByUserIdAsync(user.Id);
|
||||
var existingSession = sessions.FirstOrDefault(s => s.DeviceInfo == deviceInfo);
|
||||
var existingSession = sessions.FirstOrDefault(s => s.DeviceInfo == deviceInfo );
|
||||
|
||||
if (existingSession is not null)
|
||||
return await UpdateExistingSessionAsync(user, deviceInfo, existingSession);
|
||||
}
|
||||
catch (NotFoundByKeyException<Guid> ex)
|
||||
{
|
||||
|
||||
_logger.LogError(ex, "Could not find session for user {userId}", user.Id);
|
||||
}
|
||||
|
||||
return await CreateNewSessionAsync(user, deviceInfo);
|
||||
|
||||
Reference in New Issue
Block a user