Files
server/src/Notifications/SubjectUserIdProvider.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
294 B
C#
Raw Normal View History

2018-08-02 12:14:33 -04:00
using IdentityModel;
using Microsoft.AspNetCore.SignalR;
2018-08-16 13:45:31 -04:00
namespace Bit.Notifications;
2022-08-29 16:06:55 -04:00
2018-08-16 13:45:31 -04:00
public class SubjectUserIdProvider : IUserIdProvider
2018-08-02 12:14:33 -04:00
{
public string GetUserId(HubConnectionContext connection)
{
return connection.User?.FindFirst(JwtClaimTypes.Subject)?.Value;
}
}