Skip to content

Commit 531aca5

Browse files
fix: excluding banned users
#42
1 parent f0885f8 commit 531aca5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Nullinside.Api.Model/Shared/UserHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public static class UserHelpers {
2727
string? twitchUsername = null, string? twitchId = null) {
2828
string bearerToken = AuthUtils.GenerateBearerToken();
2929
try {
30-
User? existing = await dbContext.Users.FirstOrDefaultAsync(u => u.Email == email, token);
30+
User? existing = await dbContext.Users.FirstOrDefaultAsync(u => u.Email == email && !u.IsBanned, token);
3131
if (null == existing && !string.IsNullOrWhiteSpace(twitchUsername)) {
32-
existing = await dbContext.Users.FirstOrDefaultAsync(u => u.TwitchUsername == twitchUsername, token);
32+
existing = await dbContext.Users.FirstOrDefaultAsync(u => u.TwitchUsername == twitchUsername && !u.IsBanned, token);
3333
}
3434

3535
if (null == existing) {

0 commit comments

Comments
 (0)