again fix unnecessary exception

This commit is contained in:
rootdarkarchon
2023-10-18 10:00:56 +02:00
parent a3e2718271
commit 209a33d6f9

View File

@@ -57,7 +57,7 @@ public class SecretKeyAuthenticatorService
using var context = scope.ServiceProvider.GetService<MareDbContext>(); using var context = scope.ServiceProvider.GetService<MareDbContext>();
var authReply = await context.Auth.AsNoTracking().SingleOrDefaultAsync(u => u.HashedKey == hashedSecretKey).ConfigureAwait(false); var authReply = await context.Auth.AsNoTracking().SingleOrDefaultAsync(u => u.HashedKey == hashedSecretKey).ConfigureAwait(false);
var isBanned = authReply?.IsBanned ?? false; var isBanned = authReply?.IsBanned ?? false;
var primaryUid = authReply.PrimaryUserUID ?? authReply?.UserUID; var primaryUid = authReply?.PrimaryUserUID ?? authReply?.UserUID;
if (authReply?.PrimaryUserUID != null) if (authReply?.PrimaryUserUID != null)
{ {