Skip to content

Commit ec07863

Browse files
refactor(Core.Security): change return type of GetUserId method to object
1 parent e530086 commit ec07863

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Core.Security/Core.Security.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<RootNamespace>NArchitecture.$(AssemblyName)</RootNamespace>
77
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
88
<PackageId>NArchitecture.$(AssemblyName)</PackageId>
9-
<Version>1.1.0</Version>
9+
<Version>1.1.1</Version>
1010
<Title>NArchitecture $(AssemblyName)</Title>
1111
<Description>The NArchitecture Core.Security package provides core classes and extensions for implementing security features in the application layer in both clean and union architectures. It includes support for JWT (JSON Web Tokens) authentication, two-factor authentication (2FA), one-time passwords (OTP), e-mail handling for security purposes, hashing algorithms, encryption, and other essential utilities for implementing security measures in applications.</Description>
1212
<Product>NArchitecture</Product>

Core.Security/Extensions/ClaimsPrincipalExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public static class ClaimsPrincipalExtensions
1515
return claimsPrincipal?.Claims(ClaimTypes.Role);
1616
}
1717

18-
public static int GetUserId(this ClaimsPrincipal claimsPrincipal)
18+
public static object GetUserId(this ClaimsPrincipal claimsPrincipal)
1919
{
20-
string? result = claimsPrincipal?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
21-
return Convert.ToInt32(result);
20+
object result = claimsPrincipal?.FindFirst(ClaimTypes.NameIdentifier)?.Value!;
21+
return result;
2222
}
2323
}

0 commit comments

Comments
 (0)