We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a7e8ca commit 28e7b3cCopy full SHA for 28e7b3c
src/web/Server/Features/Chat/ChatHub.cs
@@ -1,12 +1,21 @@
1
+using Jordnaer.Shared;
2
+using Microsoft.AspNetCore.Authorization;
3
using Microsoft.AspNetCore.SignalR;
4
5
namespace Jordnaer.Server.Features.Chat;
6
7
+[Authorize]
8
public class ChatHub : Hub
9
{
10
public async Task SendMessage(string user, string message)
11
12
//TODO: Add azure signalR
13
await Clients.All.SendAsync("ReceiveMessage", user, message);
14
}
15
+
16
+ public override Task OnConnectedAsync()
17
+ {
18
+ Context.User.GetId();
19
+ return base.OnConnectedAsync();
20
+ }
21
0 commit comments