From 161e8af36c72d072c57eba7eecca566fe8176e70 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Mon, 1 Jul 2024 14:53:24 -0500 Subject: [PATCH] fix user token --- .../BotSharp.Core/Users/Services/UserService.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index 03fe8bc4..40372ed4 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -96,10 +96,13 @@ public class UserService : IUserService } //verify password is correct or not. - var hashPassword = Utilities.HashTextMd5($"{password}{record.Salt}"); - if (hashPassword != record.Password) + if (record != null) { - return default; + var hashPassword = Utilities.HashTextMd5($"{password}{record.Salt}"); + if (hashPassword != record.Password) + { + return default; + } } User? user = record;