login-control 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/login_control_module.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a0041b25da378a40ee536b9689846301d6b13eb062f2001fae995a78540094
|
4
|
+
data.tar.gz: b40069097f5b5d8e3bf2025ae63a1b3e88c4adb8a1e07c2771aa389aba4a8941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130e57bb3dc647f3785c3e1dc295e1ecc57f50359579cc516ca2b1b1ce80adc152200071bd0394e20508910b91e575769b37a076e56cec23f9c6860867a66c76
|
7
|
+
data.tar.gz: 7fa194e79c11dc09897c99412d26d3b9c16f902349e931d1f8f27ce2404262f060ed115e0cc9a4f0ab2f44b7db3d6a1afaf766f888a8c24287b973f9812828bb
|
data/lib/login_control_module.rb
CHANGED
@@ -3,12 +3,17 @@ module LoginControlModule
|
|
3
3
|
# check if captcha is to validate (does not store a cookie)
|
4
4
|
def captcha_validation?(scope: :global, login_name: nil)
|
5
5
|
rec = rc_record(scope, login_name)
|
6
|
-
logger.info "LoginControlModule => get captcha #{rec&.validate_captcha ? '' : 'NOT '}requested from record LoginControl.#{rec&.id}" if debug_request_control
|
7
6
|
if request.host == 'localhost'
|
7
|
+
logger.info "LoginControlModule => get captcha NOT requested because localhost" if debug_request_control
|
8
|
+
false
|
9
|
+
elsif Rails.env.development? || Rails.env == 'test'
|
10
|
+
logger.info "LoginControlModule => get captcha NOT requested because Rails.env #{Rails.env}" if debug_request_control
|
8
11
|
false
|
9
12
|
elsif rec
|
13
|
+
logger.info "LoginControlModule => get captcha #{rec&.validate_captcha ? '' : 'NOT '}requested from record LoginControl.#{rec&.id}" if debug_request_control
|
10
14
|
rec.validate_captcha
|
11
15
|
else
|
16
|
+
logger.info "LoginControlModule => get captcha requested (all other conditions failed)" if debug_request_control
|
12
17
|
true
|
13
18
|
end
|
14
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: login-control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Sedlmair
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Based on Login Attempts check if captcha is necessary. It stores a permanent
|
14
14
|
cookie and uses a table for tracking login requests.
|