MachUpskillingFY17 / JabbR-Core

Modern edition of JabbR chat client using .NET Core
MIT License
7 stars 8 forks source link

Implement BanCommand.cs #245

Closed ashanhol closed 7 years ago

kevinleung23 commented 7 years ago

AccountController now checks if the user.IsBanned before attempting to login with credentials. If the user.IsBanned = true, View("UserBannedNotification") is returned.

kevinleung23 commented 7 years ago
// Check if user.isBanned
                var user = await _userManager.FindByNameAsync(model.Username);
                if (user.IsBanned)
                {
                    return View("UserBannedNotification");
                }
                // If not, attempt to sign in with form credientials
kevinleung23 commented 7 years ago

Continue discussion in Issue #312

kevinleung23 commented 7 years ago

Client.Caller is not recieving "targetUser is banned" notification. Command works correctly (changes the DB) but inconsistent (sometimes takes 1-2 commands to ban targetUser)

kevinleung23 commented 7 years ago

Implemented a IsBanned Cookie Claim in startup.cs but not sure if we should include.

kevinleung23 commented 7 years ago

Client.Caller now receives correct notification as well as others in the room. Command works consistent. Decided not to implement IsBannedVerification Cookie claim since disconnecting the Target Client Connection will cause signout (unvalidates their cookie).