From d4ccc53a6ea728a3ea411efb3b690806f66cac3a Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Tue, 5 Nov 2024 06:02:17 -0600 Subject: [PATCH] Fix UserAuthenticated --- .../BotSharp.Abstraction/Users/IAuthenticationHook.cs | 3 ++- src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/IAuthenticationHook.cs b/src/Infrastructure/BotSharp.Abstraction/Users/IAuthenticationHook.cs index 36b07f11..d953271f 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Users/IAuthenticationHook.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Users/IAuthenticationHook.cs @@ -25,9 +25,10 @@ public interface IAuthenticationHook /// /// User authenticated successfully /// + /// /// /// - bool UserAuthenticated(JwtSecurityToken token) + bool UserAuthenticated(User user, Token token) => true; /// diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index 5bbd3c32..daf8a340 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -296,7 +296,7 @@ public class UserService : IUserService var (token, jwt) = BuildToken(record); foreach (var hook in hooks) { - hook.UserAuthenticated(jwt); + hook.UserAuthenticated(record, token); } return token;