10 lines
271 B
C#
10 lines
271 B
C#
|
using System.Security.Claims;
|
||
|
using Microsoft.AspNetCore.SignalR;
|
||
|
|
||
|
public class CustomUserIdProvider : IUserIdProvider
|
||
|
{
|
||
|
public virtual string GetUserId(HubConnectionContext connection)
|
||
|
{
|
||
|
return connection.User?.FindFirst(ClaimTypes.Email)?.Value;
|
||
|
}
|
||
|
}
|