mirror of
https://github.com/fergalmoran/podnoms.git
synced 2026-01-07 00:56:40 +00:00
19 lines
668 B
C#
19 lines
668 B
C#
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace PodNoms.Api.Services.Auth {
|
|
public class SignalRUserIdProvider : IUserIdProvider {
|
|
// private readonly UserManager<ApplicationUser> _userManager;
|
|
|
|
// public SignalRUserIdProvider(UserManager<ApplicationUser> userManager) {
|
|
// this._userManager = userManager;
|
|
// }
|
|
/// <inheritdoc />
|
|
public virtual string GetUserId(HubConnectionContext connection) {
|
|
var id = connection.User?.FindFirst(c => c.Type == "id")?.Value;
|
|
return id;
|
|
}
|
|
}
|
|
} |