fix null in AuthorizeAsync

This commit is contained in:
rootdarkarchon
2023-01-11 23:05:00 +01:00
parent a0cea2432f
commit 8c39f9ce81

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);
SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID, false, authReply.IsBanned); SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID, false, authReply?.IsBanned ?? false);
if (reply.Success) if (reply.Success)
{ {