login-control 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/login_control_view_helper.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14cd3fb1d7047a6bb9147ee9621bd38f19e5ef866dfb3a7d73b23b12d0ec5ad7
|
4
|
+
data.tar.gz: cf388107b5b34bd92855b68410494fa0f68357e6d12cf7010dc7a085e12cedf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45414dd37531ec9e1ff5a074b2b11e2b932575004625292da89c953bfb4987cec01d600f04516ff9764a2b516688ca45c046206b173517e68edbbc82a507d45a
|
7
|
+
data.tar.gz: a97d2f7901d51abd7196cf3f3751f5d7e95be1ede2513ed26528afcc1ca3d3ac6097d18c5824eaa493145fe6fb81e47fcf740ec25283118801611d0804923141
|
@@ -26,10 +26,15 @@ module LoginControlViewHelper
|
|
26
26
|
retry_after_seconds = (Rails.configuration.x.login_control.retry_after_seconds || 30)
|
27
27
|
logger.info "LOGIN-CONTROL => #{rec.attempts.to_i}. attempt (config.x.attempts_allowed: #{attempts_allowed})" if debug
|
28
28
|
|
29
|
-
if rec.attempts
|
29
|
+
if rec.attempts == 1
|
30
|
+
captcha_requested = false
|
31
|
+
logger.info "LOGIN-CONTROL => captcha NOT requested: because first attempt after successful login" if debug
|
32
|
+
elsif rec.attempts.to_i <= attempts_allowed
|
30
33
|
secs = Time.now - (rec.last_attempt || Time.now)
|
31
|
-
|
32
|
-
|
34
|
+
if retry_after_seconds.to_f >= secs
|
35
|
+
captcha_requested = false
|
36
|
+
logger.info "LOGIN-CONTROL => captcha #{captcha_requested ? '' : 'NOT '}requested: config.x.retry_after_seconds(#{retry_after_seconds}) >= secs(#{secs})" if debug
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
end
|