pull/9340/head
Niklas Fiekas 2021-07-03 09:05:36 +02:00
parent 477e6b5ff8
commit cb9dadc092
3 changed files with 14 additions and 5 deletions

View File

@ -6,7 +6,14 @@ import play.api.i18n.Lang
import lila.common.Nonce
case class EmbedConfig(bg: String, board: String, pieceSet: lila.pref.PieceSet, lang: Lang, req: RequestHeader, nonce: Nonce)
case class EmbedConfig(
bg: String,
board: String,
pieceSet: lila.pref.PieceSet,
lang: Lang,
req: RequestHeader,
nonce: Nonce
)
object EmbedConfig {

View File

@ -25,7 +25,7 @@ object AccessToken {
case class Id(value: String) extends AnyVal
object Id {
def random() = Id(s"lio_${SecureRandom.nextString(32)}")
def random() = Id(s"lio_${SecureRandom.nextString(32)}")
def randomPersonal() = Id(SecureRandom.nextString(16)) // TODO: remove
}

View File

@ -38,9 +38,11 @@ case class Team(
def publicForum: Boolean = !hideForum.has(true)
def passwordMatches(pw: String) =
password.forall(teamPw => teamPw.size == pw.size && teamPw.zip(pw).foldLeft(0) {
case (acc, (a, b)) => acc | (a ^ b) // constant time
} == 0)
password.forall(teamPw =>
teamPw.size == pw.size && teamPw.zip(pw).foldLeft(0) { case (acc, (a, b)) =>
acc | (a ^ b) // constant time
} == 0
)
}
object Team {