Skip to content

Commit

Permalink
Merge pull request #54 from fossapps/hotfix
Browse files Browse the repository at this point in the history
fix(userId): fix user not found error
  • Loading branch information
cyberhck authored Jun 5, 2021
2 parents 5fbb89d + 3d6350f commit 1393d03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion Micro.Auth.Api/GraphQL/Types/RefreshTokenType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using GraphQL.Types;
using Micro.Auth.Api.GraphQL.Federation;
using Micro.Auth.Storage;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.JsonWebTokens;

namespace Micro.Auth.Api.Internal.UserData.Extensions
{
Expand All @@ -13,7 +14,7 @@ public static class UserIdExtension

public static string? GetUserId(this IHttpContextAccessor httpContextAccessor)
{
return httpContextAccessor.HttpContext?.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
return httpContextAccessor.HttpContext?.User.FindFirst(JwtRegisteredClaimNames.Sub)?.Value;
}
}
}

0 comments on commit 1393d03

Please sign in to comment.