require email confirmation when signing up from proxy
parent
cbf3a35be4
commit
652eef8d79
|
@ -96,6 +96,9 @@ object Auth extends LilaController {
|
|||
}
|
||||
}
|
||||
|
||||
private def mustConfirmEmailByIP(ip: String): Fu[Boolean] =
|
||||
api.recentByIpExists(ip) >>| Mod.ipIntelCache(ip).map(80 <)
|
||||
|
||||
def signupPost = OpenBody { implicit ctx =>
|
||||
implicit val req = ctx.body
|
||||
NoTor {
|
||||
|
@ -106,7 +109,7 @@ object Auth extends LilaController {
|
|||
data => env.recaptcha.verify(~data.recaptchaResponse, req).flatMap {
|
||||
case false => BadRequest(html.auth.signup(forms.signup.website fill data, env.RecaptchaPublicKey)).fuccess
|
||||
case true =>
|
||||
api.recentByIpExists(HTTPRequest lastRemoteAddress ctx.req) flatMap { mustConfirmEmail =>
|
||||
mustConfirmEmailByIP(HTTPRequest lastRemoteAddress ctx.req) flatMap { mustConfirmEmail =>
|
||||
lila.mon.user.register.website()
|
||||
lila.mon.user.register.mustConfirmEmail(mustConfirmEmail)()
|
||||
val email = env.emailAddress.validate(data.email) err s"Invalid email ${data.email}"
|
||||
|
|
|
@ -122,7 +122,7 @@ object Mod extends LilaController {
|
|||
}
|
||||
}
|
||||
|
||||
private val ipIntelCache =
|
||||
private[controllers] val ipIntelCache =
|
||||
lila.memo.AsyncCache[String, Int](ip => {
|
||||
import play.api.libs.ws.WS
|
||||
import play.api.Play.current
|
||||
|
|
Loading…
Reference in New Issue