Modified ClaimNameAttribute to support multiple claim names depending on environment
All checks were successful
ci/woodpecker/tag/api_build Pipeline was successful
ci/woodpecker/tag/api_uploadimage Pipeline was successful

Environment name will be pulled from environment variable: ASPNETCORE_ENVIRONMENT
This commit is contained in:
2024-04-07 20:18:53 -05:00
parent 822a8379aa
commit 9fae3b978f
6 changed files with 27 additions and 13 deletions

View File

@ -4,19 +4,19 @@ namespace YABA.Common.Lookups
{
public enum ClaimsLookup
{
[ClaimNameAttribute("https://dev.iwanaga.moe/api/auth_provider_id")]
[ClaimName("https://auth.dev.iwanaga.moe/api/auth_provider_id", "https://auth.iwanaga.moe/api/auth_provider_id")]
AuthProviderId = 1,
[ClaimNameAttribute("https://dev.iwanaga.moe/api/email_address")]
[ClaimName("https://auth.dev.iwanaga.moe/api/email_address", "https://auth.iwanaga.moe/api/email_address")]
UserEmail = 2,
[ClaimNameAttribute("https://dev.iwanaga.moe/api/email_verified")]
[ClaimName("https://auth.dev.iwanaga.moe/api/email_verified", "https://auth.iwanaga.moe/api/email_verified")]
IsEmailConfirmed = 3,
[ClaimNameAttribute("https://dev.iwanaga.moe/api/username")]
[ClaimName("https://auth.dev.iwanaga.moe/api/username", "https://auth.iwanaga.moe/api/username")]
Username = 4,
[ClaimNameAttribute("https://dev.iwanaga.moe/api/id")]
[ClaimName("https://auth.dev.iwanaga.moe/api/id", "https://auth.iwanaga.moe/api/id")]
UserId = 5
}
}