improve firewall
This commit is contained in:
parent
2925b4138f
commit
3c9252d0a5
|
@ -68,7 +68,7 @@ trait AuthImpl {
|
||||||
|
|
||||||
protected def restoreUser(req: RequestHeader): Option[User] = for {
|
protected def restoreUser(req: RequestHeader): Option[User] = for {
|
||||||
sessionId ← req.session.get("sessionId")
|
sessionId ← req.session.get("sessionId")
|
||||||
if env.security.firewall accepts req
|
if env.security.firewall acceptsOrLog req
|
||||||
username ← env.security.store.getUsername(sessionId)
|
username ← env.security.store.getUsername(sessionId)
|
||||||
user ← (env.user.userRepo byId username).unsafePerformIO
|
user ← (env.user.userRepo byId username).unsafePerformIO
|
||||||
} yield user
|
} yield user
|
||||||
|
|
|
@ -37,6 +37,13 @@ final class Firewall(
|
||||||
|
|
||||||
def accepts(req: RequestHeader): Boolean = !blocks(req)
|
def accepts(req: RequestHeader): Boolean = !blocks(req)
|
||||||
|
|
||||||
|
def acceptsOrLog(req: RequestHeader): Boolean =
|
||||||
|
if (accepts(req)) true
|
||||||
|
else {
|
||||||
|
logBlock(req)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
def refresh { ips = fetch }
|
def refresh { ips = fetch }
|
||||||
|
|
||||||
def blockIp(ip: String) {
|
def blockIp(ip: String) {
|
||||||
|
|
1
todo
1
todo
|
@ -52,3 +52,4 @@ send lobby new forum posts html through websockets
|
||||||
in table, hide lichess_control when it's empty (watcher mode)
|
in table, hide lichess_control when it's empty (watcher mode)
|
||||||
BUG tournament idle resign: based on 20 seconds added time! can make black resign by playing after 19s
|
BUG tournament idle resign: based on 20 seconds added time! can make black resign by playing after 19s
|
||||||
tournament join, sometimes withdraws by cron
|
tournament join, sometimes withdraws by cron
|
||||||
|
tournament: no cheater
|
||||||
|
|
Loading…
Reference in a new issue