Newsbot.Collector/Newsbot.Collector.Api/Middleware/JwtUserIdExtension.cs

9 lines
230 B
C#
Raw Normal View History

namespace Newsbot.Collector.Api.Middleware;
public static class JwtUserIdExtension
{
public static string GetUserId(this HttpContext context)
{
return context.User.Claims.Single(x => x.Type == "id").Value;
}
}