login-control 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14cd3fb1d7047a6bb9147ee9621bd38f19e5ef866dfb3a7d73b23b12d0ec5ad7
4
- data.tar.gz: cf388107b5b34bd92855b68410494fa0f68357e6d12cf7010dc7a085e12cedf5
3
+ metadata.gz: 8e5fe55ef77a1e22cb8412309533eb689fad1eb6974a4bc655c90ecbdd9537f8
4
+ data.tar.gz: 2ac316f6a3332f45e795b2e5fb70cb842a7a30b98685daa7c009e01dbf09f07c
5
5
  SHA512:
6
- metadata.gz: 45414dd37531ec9e1ff5a074b2b11e2b932575004625292da89c953bfb4987cec01d600f04516ff9764a2b516688ca45c046206b173517e68edbbc82a507d45a
7
- data.tar.gz: a97d2f7901d51abd7196cf3f3751f5d7e95be1ede2513ed26528afcc1ca3d3ac6097d18c5824eaa493145fe6fb81e47fcf740ec25283118801611d0804923141
6
+ metadata.gz: b1dc3fed49863c7173a6333c8a44e8775214596af7d5f2807c97514561c168ef1dc053c52549df4dc0afc247954ae86ced7af133131ce1eeb9921e7ca29e782f
7
+ data.tar.gz: c504a82898c66b3658c89469797633f50b050a52699a6afa80bf7ff4cfc8038fc0f1ca7a7ef8ab385b59fe8b1fd89f931e4c83f154130d20c0a7b411a51179b2
data/README.md CHANGED
@@ -16,7 +16,7 @@ On localhost captcha is never required.
16
16
 
17
17
  ## Installation
18
18
 
19
- `gem 'request-control'
19
+ `gem 'request-control'`
20
20
 
21
21
  run
22
22
  ```
@@ -25,9 +25,17 @@ $ rails g model login_control session_id:string login_name:string scope:string s
25
25
  $ rails db:migrate
26
26
  ```
27
27
 
28
- Login Form
28
+ initializer
29
+ ```
30
+ require 'login_control_module'
31
+ require 'login_control_view_helper'
32
+ ```
29
33
 
30
- `include RequestControlViewHelper`
34
+ ApplicationHelper
35
+
36
+ `include LoginControlViewHelper`
37
+
38
+ Login Form
31
39
 
32
40
  ```
33
41
  - if captcha_tag?
@@ -39,7 +47,7 @@ Controller example for subclassed devise controller
39
47
  ```
40
48
  class SessionsController < Devise::SessionsController
41
49
 
42
- include RequestControlModule
50
+ include LoginControlModule
43
51
 
44
52
  def create
45
53
  notice_request_attempt
@@ -31,7 +31,7 @@ module LoginControlViewHelper
31
31
  logger.info "LOGIN-CONTROL => captcha NOT requested: because first attempt after successful login" if debug
32
32
  elsif rec.attempts.to_i <= attempts_allowed
33
33
  secs = Time.now - (rec.last_attempt || Time.now)
34
- if retry_after_seconds.to_f >= secs
34
+ if secs >= retry_after_seconds.to_f
35
35
  captcha_requested = false
36
36
  logger.info "LOGIN-CONTROL => captcha #{captcha_requested ? '' : 'NOT '}requested: config.x.retry_after_seconds(#{retry_after_seconds}) >= secs(#{secs})" if debug
37
37
  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.8
4
+ version: 0.0.10
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-09 00:00:00.000000000 Z
11
+ date: 2023-01-13 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.