devise_userbin 0.5.3 → 0.6.0

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: 2eeb1d9745fae28ac0274c2e6dbccc1e5681e356
4
- data.tar.gz: 0061f12da35209363cec862f5b4ff88e6ea77f59
3
+ metadata.gz: 5e314c1646c87d1007135c071f79d2f18c9b2778
4
+ data.tar.gz: 16fe4f53110ac4c15476aa0eec98e4d672bdd81e
5
5
  SHA512:
6
- metadata.gz: b2b9a1dd1779d85495346fdbcfbfce480a2c474e5be3c34b19456640c7e75578794166ad97d3638595aff73cf73644dab82656d84a23cad2cc4b613afd9d0812
7
- data.tar.gz: e67750f6cd63a3738814bd96ed173736ebdd6a6a73d7e22c893dfc9c2e8e4a343e01862e451b0d4db7e209ae024d5f7e23e6311a36e15e5255bd3db64839a968
6
+ metadata.gz: 82836adb7d582a7513a0b605ede8bdef77cff96417b00bfd454489001a3a1167ff167c35255f206f9a27449c0ed22ac71de0d0d7916f0bacbd6fa97ad53c1a2e
7
+ data.tar.gz: bdeffb6964effbe01000bc63f4cb135e0494e7be580eb800e3e55042b1b41fb410d57f2d6933f35933e731be798f819ee8e2e34eff6f78fc58962f28c5411773
@@ -8,12 +8,15 @@ class Devise::DeviseUserbinController < DeviseController
8
8
  end
9
9
 
10
10
  def new
11
- challenge = env['userbin'].challenges.create
12
- redirect_to edit_user_two_factor_authentication_path(challenge.id) # todo:
11
+ challenge = userbin.challenges.create
12
+ Devise.mappings.keys.flatten.any? do |scope|
13
+ redirect_to send(
14
+ "edit_#{scope}_two_factor_authentication_path", challenge.id)
15
+ end
13
16
  end
14
17
 
15
18
  def edit
16
- @challenge = env['userbin'].challenges.find(params[:id])
19
+ @challenge = userbin.challenges.find(params[:id])
17
20
 
18
21
  # Prevent "undefined method `errors' for nil:NilClass"
19
22
  self.resource = resource_class.new
@@ -26,9 +29,9 @@ class Devise::DeviseUserbinController < DeviseController
26
29
  code = params.require(:code)
27
30
 
28
31
  begin
29
- env['userbin'].challenges.verify(challenge_id, response: code)
32
+ userbin.challenges.verify(challenge_id, response: code)
30
33
 
31
- env['userbin'].trust_device if params[:trust_device]
34
+ userbin.trust_device if params[:trust_device]
32
35
 
33
36
  Devise.mappings.keys.flatten.any? do |scope|
34
37
  redirect_to after_sign_in_path_for(scope)
@@ -49,7 +52,7 @@ class Devise::DeviseUserbinController < DeviseController
49
52
  private
50
53
 
51
54
  def return_not_found
52
- unless env['userbin'].mfa_in_progress?
55
+ unless userbin.mfa_in_progress?
53
56
  redirect_to after_sign_in_path_for(resource_name)
54
57
  end
55
58
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseUserbin
2
- VERSION = "0.5.3".freeze
2
+ VERSION = "0.6.0".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.3
4
+ version: 0.6.0
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-16 00:00:00.000000000 Z
11
+ date: 2014-11-20 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.4.0
33
+ version: 1.6.1
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.4.0
40
+ version: 1.6.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement