1
0
mirror of https://github.com/bitwarden/server synced 2026-01-06 02:23:51 +00:00

PM 12001 - Fix Empty User Search 500 (#4770)

* Setting null if user2Fa is empty. Added null check to view as well.

* Not setting the temp data at all if empty.
This commit is contained in:
Jared McCannon
2024-09-13 12:03:53 -05:00
committed by GitHub
parent fd07de736d
commit e5c77d5f90
2 changed files with 9 additions and 2 deletions

View File

@@ -73,7 +73,9 @@
@if (featureService.IsEnabled(Bit.Core.FeatureFlagKeys.MembersTwoFAQueryOptimization))
{
var usersTwoFactorIsEnabled = TempData["UsersTwoFactorIsEnabled"] as IEnumerable<(Guid userId, bool twoFactorIsEnabled)>;
@if(usersTwoFactorIsEnabled.FirstOrDefault(tuple => tuple.userId == user.Id).twoFactorIsEnabled)
var matchingUser2Fa = usersTwoFactorIsEnabled?.FirstOrDefault(tuple => tuple.userId == user.Id);
@if(matchingUser2Fa is { twoFactorIsEnabled: true })
{
<i class="fa fa-lock fa-lg fa-fw" title="2FA Enabled"></i>
}