diff --git a/dotnet-authserver/src/TeacherIdentity.AuthServer/UserClaimHelper.cs b/dotnet-authserver/src/TeacherIdentity.AuthServer/UserClaimHelper.cs index 3ec6a9c55..ac02ba443 100644 --- a/dotnet-authserver/src/TeacherIdentity.AuthServer/UserClaimHelper.cs +++ b/dotnet-authserver/src/TeacherIdentity.AuthServer/UserClaimHelper.cs @@ -91,9 +91,6 @@ public async Task> GetPublicClaims(Guid userId, TrnMa if (trnMatchPolicy is not null) { - Debug.Assert(user.TrnLookupStatus.HasValue); - claims.Add(new Claim(CustomClaims.TrnLookupStatus, user.TrnLookupStatus!.Value.ToString())); - var haveSufficientTrnMatch = user.Trn is not null && (trnMatchPolicy == TrnMatchPolicy.Default || user.TrnVerificationLevel == TrnVerificationLevel.Medium || @@ -102,7 +99,10 @@ public async Task> GetPublicClaims(Guid userId, TrnMa if (haveSufficientTrnMatch) { + Debug.Assert(user.Trn is not null); + Debug.Assert(user.TrnLookupStatus.HasValue); claims.Add(new Claim(CustomClaims.Trn, user.Trn!)); + claims.Add(new Claim(CustomClaims.TrnLookupStatus, user.TrnLookupStatus!.Value.ToString())); if (trnMatchPolicy == TrnMatchPolicy.Strict) {