Skip to content

Commit

Permalink
fix UserId
Browse files Browse the repository at this point in the history
  • Loading branch information
Talento90 committed Oct 12, 2024
1 parent b14e932 commit ef3fba5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Caravel/Caravel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<PackageVersion>0.30.0</PackageVersion>
<PackageVersion>0.31.0</PackageVersion>
<PackageTags>dotnet,sdk</PackageTags>
<Title>Caravel</Title>
<Description>Caravel is a package that contains common utilities for building dotnet applications.</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/Caravel/Security/ClaimsPrincipalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class ClaimsPrincipalExtensions
/// <returns>Return the current user id or null if does not exists.</returns>
public static string? UserId(this ClaimsPrincipal principal)
{
return principal.Claim(SubjectClaim);
return principal.Claim(SubjectClaim) ?? principal.Claim(ClaimTypes.NameIdentifier);
}

/// <summary>
Expand Down

0 comments on commit ef3fba5

Please sign in to comment.