From 0003a66de3fc9b67235abbfab74e65e586b9c6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= Date: Tue, 21 Jan 2025 13:28:21 -0500 Subject: [PATCH] fix: exception when calling database There appears to be a bug in the current version of the MySQL entity framework implementation where using the string's ".Equals" results in a "LCASE" command that throws a null reference exception. Since MySQL is not case sensitive we can simple remove this part of the database calls for now... --- .../Middleware/BasicAuthenticationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nullinside.Api.Common.AspNetCore/Middleware/BasicAuthenticationHandler.cs b/src/Nullinside.Api.Common.AspNetCore/Middleware/BasicAuthenticationHandler.cs index 9d1a321..ca1b877 100644 --- a/src/Nullinside.Api.Common.AspNetCore/Middleware/BasicAuthenticationHandler.cs +++ b/src/Nullinside.Api.Common.AspNetCore/Middleware/BasicAuthenticationHandler.cs @@ -60,7 +60,7 @@ protected override async Task HandleAuthenticateAsync() { .Include(i => i.Roles) .AsNoTracking() .FirstOrDefaultAsync(u => !string.IsNullOrWhiteSpace(u.Token) && - u.Token.Equals(token, StringComparison.InvariantCultureIgnoreCase) && + u.Token == token && !u.IsBanned); if (null == dbUser) {