mirror of
https://github.com/Caraxi/mare.server.git
synced 2026-01-02 21:33:40 +01:00
some changes to auth
This commit is contained in:
parent
3634cccd1e
commit
cbe361208c
3 changed files with 30 additions and 18 deletions
|
|
@ -131,8 +131,6 @@ public partial class MareHub : Hub<IMareHub>, IMareHub
|
|||
|
||||
if (!string.IsNullOrEmpty(userCharaIdent))
|
||||
{
|
||||
_mareMetrics.DecGauge(MetricsAPI.GaugeAuthorizedConnections);
|
||||
|
||||
_logger.LogCallInfo();
|
||||
_clientIdentService.MarkUserOffline(AuthenticatedUserId);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,8 @@ public class UserRequirementHandler : AuthorizationHandler<UserRequirement, HubI
|
|||
protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, UserRequirement requirement, HubInvocationContext resource)
|
||||
{
|
||||
var uid = context.User.Claims.SingleOrDefault(g => string.Equals(g.Type, ClaimTypes.NameIdentifier, StringComparison.Ordinal))?.Value;
|
||||
var auth = context.User.Claims.SingleOrDefault(g => string.Equals(g.Type, ClaimTypes.Authentication, StringComparison.Ordinal))?.Value;
|
||||
|
||||
if (uid == null || auth == null) context.Fail();
|
||||
if (uid == null) context.Fail();
|
||||
|
||||
if ((requirement.Requirements & UserRequirements.Identified) is UserRequirements.Identified)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue