Files
server/src/Notifications/SubjectUserIdProvider.cs

14 lines
324 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
2018-08-02 12:14:33 -04:00
{
public class SubjectUserIdProvider : IUserIdProvider
{
public string GetUserId(HubConnectionContext connection)
{
return connection.User?.FindFirst(JwtClaimTypes.Subject)?.Value;
}
}
}