Skip to content

Commit 9d8a936

Browse files
authored
Merge pull request #1225 from iceljc/master
change http
2 parents 0ec2487 + a53bb30 commit 9d8a936

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/Infrastructure/BotSharp.Abstraction/Repositories/Filters/RoleFilter.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ namespace BotSharp.Abstraction.Repositories.Filters;
44

55
public class RoleFilter
66
{
7-
[JsonPropertyName("names")]
87
public IEnumerable<string>? Names { get; set; }
9-
10-
[JsonPropertyName("exclude_roles")]
118
public IEnumerable<string>? ExcludeRoles { get; set; } = UserConstant.AdminRoles;
129

1310

src/Infrastructure/BotSharp.OpenAPI/Controllers/User/RoleController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public async Task<IEnumerable<string>> GetRoleOptions()
3636
}
3737

3838
[BotSharpAuth]
39-
[HttpPost("/roles")]
40-
public async Task<IEnumerable<RoleViewModel>> GetRoles([FromBody] RoleFilter? filter = null)
39+
[HttpGet("/roles")]
40+
public async Task<IEnumerable<RoleViewModel>> GetRoles([FromQuery] RoleFilter? filter = null)
4141
{
4242
if (filter == null)
4343
{

src/Plugins/BotSharp.Plugin.ChatHub/SignalRHub.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public class SignalRHub : Hub
1212
private readonly IUserIdentity _user;
1313
private readonly IHttpContextAccessor _context;
1414

15-
public SignalRHub(IServiceProvider services,
15+
public SignalRHub(
16+
IServiceProvider services,
1617
ILogger<SignalRHub> logger,
1718
IUserIdentity user,
1819
IHttpContextAccessor context)
@@ -25,15 +26,16 @@ public SignalRHub(IServiceProvider services,
2526

2627
public override async Task OnConnectedAsync()
2728
{
28-
_logger.LogInformation($"SignalR Hub: {_user.FirstName} {_user.LastName} ({Context.User.Identity.Name}) connected in {Context.ConnectionId}");
29-
3029
var convService = _services.GetRequiredService<IConversationService>();
31-
var httpContext = Context.GetHttpContext();
30+
var httpContext = Context?.GetHttpContext();
31+
32+
_logger.LogInformation($"SignalR Hub: {_user?.FirstName} {_user?.LastName} ({Context?.User?.Identity?.Name ?? "Unkown user"}) connected in {Context?.ConnectionId}");
33+
3234
string? conversationId = httpContext?.Request?.Query["conversation-id"].FirstOrDefault();
3335

3436
if (!string.IsNullOrEmpty(conversationId))
3537
{
36-
_logger.LogInformation($"Connection {Context.ConnectionId} is with conversation {conversationId}");
38+
_logger.LogInformation($"Connection {Context?.ConnectionId} is with conversation {conversationId}");
3739
await AddGroup(conversationId);
3840

3941
var conv = await convService.GetConversation(conversationId);

0 commit comments

Comments
 (0)