only lowercase usernames in security db
This commit is contained in:
parent
0b75ca0f13
commit
f2a83824c1
|
@ -20,7 +20,7 @@ private[security] final class Api(firewall: Firewall) {
|
||||||
|
|
||||||
def saveAuthentication(username: String)(implicit req: RequestHeader): Fu[String] = {
|
def saveAuthentication(username: String)(implicit req: RequestHeader): Fu[String] = {
|
||||||
val sessionId = Random nextString 12
|
val sessionId = Random nextString 12
|
||||||
Store.save(sessionId, username, req) inject sessionId
|
Store.save(sessionId, username.toLowerCase, req) inject sessionId
|
||||||
}
|
}
|
||||||
|
|
||||||
// blocking function, required by Play2 form
|
// blocking function, required by Play2 form
|
||||||
|
@ -30,8 +30,8 @@ private[security] final class Api(firewall: Firewall) {
|
||||||
def restoreUser(req: RequestHeader): Fu[Option[User]] =
|
def restoreUser(req: RequestHeader): Fu[Option[User]] =
|
||||||
firewall accepts req flatMap {
|
firewall accepts req flatMap {
|
||||||
_ ?? {
|
_ ?? {
|
||||||
req.session.get("sessionId").fold(fuccess(none[User])) { sessionId ⇒
|
req.session.get("sessionId") ?? { sessionId ⇒
|
||||||
Store userId sessionId flatMap { _.??(UserRepo.named) }
|
Store userId sessionId flatMap { _ ?? UserRepo.byId }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ object Store {
|
||||||
|
|
||||||
type IP = String
|
type IP = String
|
||||||
|
|
||||||
def save(sessionId: String, userId: String, req: RequestHeader): Funit =
|
private[security] def save(sessionId: String, userId: String, req: RequestHeader): Funit =
|
||||||
$insert(Json.obj(
|
$insert(Json.obj(
|
||||||
"_id" -> sessionId,
|
"_id" -> sessionId,
|
||||||
"user" -> userId,
|
"user" -> userId,
|
||||||
|
|
1
todo
1
todo
|
@ -69,7 +69,6 @@ the forum search user:mephostophilis returns no result
|
||||||
check team average elo http://en.lichess.org/inbox/benuegti#bottom
|
check team average elo http://en.lichess.org/inbox/benuegti#bottom
|
||||||
if game ends during move -> bug
|
if game ends during move -> bug
|
||||||
LilaError['[analysis] fred65 already analyses ueogn4fr, won't process ueogn4fr']
|
LilaError['[analysis] fred65 already analyses ueogn4fr, won't process ueogn4fr']
|
||||||
link http://webchat.freenode.net/?channels=lichess
|
|
||||||
"continue from here" does not continue from current pos. also should lazy load fen
|
"continue from here" does not continue from current pos. also should lazy load fen
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in a new issue