Skip to content

Commit 96aaa2a

Browse files
committed
Fix redacting logic not working correctly
1 parent ed8cbf8 commit 96aaa2a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ReplayBrowser/Helpers/ReplayHelper.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ public async Task<List<Replay>> GetMostRecentReplays(AuthenticationState state)
5757

5858
if (accountRequested is { RedactInformation: true })
5959
{
60-
if (accountCaller == null || accountCaller.Guid != playerGuid)
60+
if (accountCaller == null || !accountCaller.IsAdmin)
6161
{
62-
switch (accountCaller)
62+
if (accountCaller?.Guid != playerGuid)
6363
{
64-
case null:
65-
throw new UnauthorizedAccessException("This account is private.");
66-
case { IsAdmin: false }:
67-
throw new UnauthorizedAccessException("This account is private.");
64+
throw new UnauthorizedAccessException("The account you are trying to view is private. Contact the account owner and ask them to make their account public.");
6865
}
6966
}
7067
}

0 commit comments

Comments
 (0)