Skip to content

Commit

Permalink
added ban check to login http handler
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-haydon committed Aug 31, 2012
1 parent 7f85193 commit d9c2b8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions JabbR/Auth/Login.ashx.cs
Expand Up @@ -109,6 +109,13 @@ public void ProcessRequest(HttpContext context)
repository.CommitChanges();
}

// IsBanned is set to false if the user is new
// but check is placed here so it doesn't need to be checked twice in above user-if-conditions
if (user.IsBanned)
{
throw new InvalidOperationException("You're banned, sorry.");
}

// Save the cokie state
var state = JsonConvert.SerializeObject(new { userId = user.Id });
var cookie = new HttpCookie("jabbr.state", state);
Expand Down

0 comments on commit d9c2b8e

Please sign in to comment.