devise_userbin 0.5.2 → 0.5.3

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
  SHA1:
3
- metadata.gz: aed4286abbffee0cfd7d4ca3777ac65f34d0425e
4
- data.tar.gz: 0d4847b20c06c6a08cb3e0b6aa5806def5de80c0
3
+ metadata.gz: 2eeb1d9745fae28ac0274c2e6dbccc1e5681e356
4
+ data.tar.gz: 0061f12da35209363cec862f5b4ff88e6ea77f59
5
5
  SHA512:
6
- metadata.gz: 8e6570a7b3bc6625536051544c9b74b449901928b9f7277ff8296a85d84a7a7efb0e64780caba35de8469392faa42d429f1bd6abfd15241f714d722798d8d4c7
7
- data.tar.gz: d46d32140092bd00a8e51260fdb9b3114d7b17def0ffa2b1a1104ca465a096c6d3e93f63a1ea561aab7b2489c29a8d77d774b1e5202c08bc2ac32d763471cef8
6
+ metadata.gz: b2b9a1dd1779d85495346fdbcfbfce480a2c474e5be3c34b19456640c7e75578794166ad97d3638595aff73cf73644dab82656d84a23cad2cc4b613afd9d0812
7
+ data.tar.gz: e67750f6cd63a3738814bd96ed173736ebdd6a6a73d7e22c893dfc9c2e8e4a343e01862e451b0d4db7e209ae024d5f7e23e6311a36e15e5255bd3db64839a968
@@ -28,10 +28,12 @@ class Devise::DeviseUserbinController < DeviseController
28
28
  begin
29
29
  env['userbin'].challenges.verify(challenge_id, response: code)
30
30
 
31
+ env['userbin'].trust_device if params[:trust_device]
32
+
31
33
  Devise.mappings.keys.flatten.any? do |scope|
32
34
  redirect_to after_sign_in_path_for(scope)
33
35
  end
34
- rescue Userbin::Error => error
36
+ rescue Userbin::Error
35
37
  sign_out_with_message(:no_retries_remaining, :alert)
36
38
  end
37
39
  end
@@ -5,7 +5,8 @@
5
5
  <%= form_tag([resource_name, :two_factor_authentication], :method => :put) do %>
6
6
  <%= devise_error_messages! %>
7
7
  <p><%= label_tag :code, t("devise.two_factor_authentication.edit.common.code_label") %><br />
8
- <%= text_field_tag :code %>
8
+ <%= text_field_tag :code %></p>
9
+ <p><%= check_box_tag :trust_device %> <%= label_tag :trust_device %></p>
9
10
  <%= hidden_field_tag(:challenge_id, @challenge.id) %>
10
11
  <p><%= submit_tag t("devise.two_factor_authentication.edit.common.submit_button") %></p>
11
12
  <% end -%>
@@ -8,7 +8,8 @@
8
8
  <%= form_tag([resource_name, :two_factor_authentication], :method => :put) do %>
9
9
  <%= devise_error_messages! %>
10
10
  <p><%= label_tag :code, t("devise.two_factor_authentication.edit.common.code_label") %><br />
11
- <%= text_field_tag :code %>
11
+ <%= text_field_tag :code %></p>
12
+ <p><%= check_box_tag :trust_device %> <%= label_tag :trust_device %></p>
12
13
  <%= hidden_field_tag(:challenge_id, @challenge.id) %>
13
14
  <p><%= submit_tag t("devise.two_factor_authentication.edit.common.submit_button") %></p>
14
15
  <% end -%>
@@ -5,7 +5,8 @@
5
5
  <%= form_tag([resource_name, :two_factor_authentication], :method => :put) do %>
6
6
  <%= devise_error_messages! %>
7
7
  <p><%= label_tag :code, t("devise.two_factor_authentication.edit.common.code_label") %><br />
8
- <%= text_field_tag :code %>
8
+ <%= text_field_tag :code %></p>
9
+ <p><%= check_box_tag :trust_device %> <%= label_tag :trust_device %></p>
9
10
  <%= hidden_field_tag(:challenge_id, @challenge.id) %>
10
11
  <p><%= submit_tag t("devise.two_factor_authentication.edit.common.submit_button") %></p>
11
12
  <% end -%>
@@ -1,5 +1,6 @@
1
1
  Warden::Manager.on_request do |warden|
2
- warden.request.env['userbin'] = Userbin::Client.new(warden.request)
2
+ warden.request.env['userbin'] =
3
+ Userbin::Client.new(warden.request, warden.cookies)
3
4
  end
4
5
 
5
6
  Warden::Manager.before_logout do |record, warden, opts|
@@ -1,3 +1,3 @@
1
1
  module DeviseUserbin
2
- VERSION = "0.5.2".freeze
2
+ VERSION = "0.5.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_userbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan Brissmyr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3.0
33
+ version: 1.4.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.3.0
40
+ version: 1.4.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement