amantinband / clean-architecture

The ultimate clean architecture template for .NET applications 💪
MIT License
1.4k stars 221 forks source link

Adding constants for custom claims #5

Closed amirhessampourhossein closed 7 months ago

amirhessampourhossein commented 7 months ago

In your JwtTokenGenerator class there are two magic strings used as custom claim names. we could use constants like below 👇

public static class CustomClaims
{
    public const string Id = "id";
    public const string Permissions = "permissions";
}

what do you think ? @amantinband

amantinband commented 7 months ago

Nah, when constant strings are used only in one place and there isn't added value by extracting them to a separate location I prefer inlining them.