login-control 0.0.12 → 0.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ea0f78366e9c6df5f607dcf3801d2e84fb4fe96d8f1a82f3ef255475882a230
4
- data.tar.gz: de45c02638f0e0dc61ea957c0b10e8bf629a49e3052ae230c8cefe2781a0a01e
3
+ metadata.gz: 79173cf05ae33b909d18f5d0133cc5f5923a441eaac6a97c46f7014954366b78
4
+ data.tar.gz: 4b397e66649e66d8f5e46f396869cf7dd509fbbff0fdba3f03fd350dc70d49c0
5
5
  SHA512:
6
- metadata.gz: 18264367c3b418af8ae901fbe7afe173b31da25af42fd5ec2ba43493e56f4321ed890fe60fe5fa9277c7b3c9a820fe22f731ed940a172e03dbee3eaadad4266a
7
- data.tar.gz: d6191a82cd30050ab721a541a116b9a6649686b3dd9ac62bf2073a91d37af3b724da9b10a190f804ba61fa526b81665587e21bf6cd8ed77a719957c02e05f76d
6
+ metadata.gz: b76a4df603b6c1ae5fef560f30fa75f4727a8775109c1e4546a23c3a19d4cb10900680d4b2a8f22ee2da5112bfad9dbce48f8fc49c7ef8a8a608fa8275a073a8
7
+ data.tar.gz: 00e6e60b838174b6d380757bb76855c403b450bca000fab74820b93269fbbce3d1790927cd110f3fc39f34c3c27ecff00847750c52059db473392d035a886ae3
@@ -40,7 +40,7 @@ module LoginControlModule
40
40
  id = SecureRandom.hex(20)
41
41
  logger.info "LoginControlModule.find_or_build_rc_record => created cookie by id: «#{id}»" if debug_request_control
42
42
  cookies.encrypted.permanent[:login_control] = id
43
- LoginControl.new(session_id: id, scope: scope, login_name: login_name)
43
+ LoginControl.new(session_id: id, scope: scope, login_name: login_name, validate_captcha: true)
44
44
  end
45
45
  end
46
46
 
@@ -26,7 +26,10 @@ module LoginControlViewHelper
26
26
  retry_after_seconds = (Rails.configuration.x.login_control.retry_after_seconds || 30)
27
27
  logger.info "LoginControlViewHelper.captcha_tag? => #{rec.attempts.to_i}. attempt (config.x.attempts_allowed: #{attempts_allowed})" if debug
28
28
 
29
- if rec.attempts == 1
29
+ if rec.sign_in_success.to_i == 0
30
+ captcha_requested = true
31
+ logger.info "LoginControlViewHelper.captcha_tag? => captcha requested: because no successful login yet" if debug
32
+ elsif rec.attempts == 1
30
33
  captcha_requested = false
31
34
  logger.info "LoginControlViewHelper.captcha_tag? => captcha NOT requested: because first attempt after successful login" if debug
32
35
  elsif rec.attempts.to_i <= attempts_allowed
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: login-control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair