devise-authy 1.5.2 → 1.5.3
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/VERSION +1 -1
- data/app/controllers/devise/devise_authy_controller.rb +5 -3
- data/authy-devise-demo/Gemfile.lock +1 -1
- data/devise-authy.gemspec +3 -3
- data/lib/devise-authy.rb +3 -4
- data/spec/controllers/devise_authy_controller_spec.rb +5 -5
- data/spec/rails-app/Gemfile.lock +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a567fa8bbad855383c29a5bda348dbeb6d57b63
|
4
|
+
data.tar.gz: 5157b30f2294c1c5f07cba33b538daf4b137efa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 796c3197ca44d7658a11bb7cf0d67aebdbce65f83c40e2cc6fb9dfeeddffa8844f73476edefb4e05d13d3fa7799c2088c94daedd42112d1709b0861f54f684a5
|
7
|
+
data.tar.gz: ba9c039d84e42c35bfec5edeb1a9ac8c5ee1a29cff04f4505521ac7a42cdb276a194ba193b5685ec2f53d194758844b835dc5ad23934458bac861b41f3125e6d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.3
|
@@ -77,10 +77,12 @@ class Devise::DeviseAuthyController < DeviseController
|
|
77
77
|
|
78
78
|
# Disable 2FA
|
79
79
|
def POST_disable_authy
|
80
|
-
|
81
|
-
|
80
|
+
response = Authy::API.delete_user(:id => resource.authy_id)
|
81
|
+
|
82
|
+
if response.ok?
|
83
|
+
resource.update_attribute(:authy_enabled, false)
|
84
|
+
resource.update_attribute(:authy_id, nil)
|
82
85
|
|
83
|
-
if resource.save
|
84
86
|
set_flash_message(:notice, :disabled)
|
85
87
|
else
|
86
88
|
set_flash_message(:error, :not_disabled)
|
data/devise-authy.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: devise-authy 1.5.
|
5
|
+
# stub: devise-authy 1.5.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "devise-authy"
|
9
|
-
s.version = "1.5.
|
9
|
+
s.version = "1.5.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Authy Inc."]
|
14
|
-
s.date = "2014-06-
|
14
|
+
s.date = "2014-06-11"
|
15
15
|
s.description = "Authy plugin for Devise"
|
16
16
|
s.email = "support@authy.com"
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/devise-authy.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'active_support/concern'
|
2
2
|
require 'active_support/core_ext/integer/time'
|
3
|
+
require 'devise'
|
3
4
|
require 'authy'
|
4
5
|
|
5
6
|
module Devise
|
@@ -7,10 +8,6 @@ module Devise
|
|
7
8
|
@@authy_remember_device = 1.month
|
8
9
|
end
|
9
10
|
|
10
|
-
require 'devise'
|
11
|
-
require 'devise-authy/routes'
|
12
|
-
require 'devise-authy/rails'
|
13
|
-
|
14
11
|
module DeviseAuthy
|
15
12
|
autoload :Mapping, 'devise-authy/mapping'
|
16
13
|
|
@@ -24,6 +21,8 @@ module DeviseAuthy
|
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
24
|
+
require 'devise-authy/routes'
|
25
|
+
require 'devise-authy/rails'
|
27
26
|
require 'devise-authy/models/authy_authenticatable'
|
28
27
|
|
29
28
|
Devise.add_module :authy_authenticatable, :model => 'devise-authy/models/authy_authenticatable', :controller => :devise_authy, :route => :authy
|
@@ -122,8 +122,7 @@ describe Devise::DeviseAuthyController do
|
|
122
122
|
describe "POST #disable_authy" do
|
123
123
|
it "Should disable 2FA" do
|
124
124
|
sign_in @user
|
125
|
-
@user.authy_enabled
|
126
|
-
@user.save
|
125
|
+
@user.update_attribute(:authy_enabled, true)
|
127
126
|
|
128
127
|
post :POST_disable_authy
|
129
128
|
@user.reload
|
@@ -135,10 +134,11 @@ describe Devise::DeviseAuthyController do
|
|
135
134
|
|
136
135
|
it "Should not disable 2FA" do
|
137
136
|
sign_in @user
|
138
|
-
@user.authy_enabled
|
139
|
-
@user.save
|
137
|
+
@user.update_attribute(:authy_enabled, true)
|
140
138
|
|
141
|
-
|
139
|
+
authy_response = mock('authy_response')
|
140
|
+
authy_response.stub(:ok?).and_return(false)
|
141
|
+
Authy::API.should_receive(:delete_user).with(:id => @user.authy_id.to_s).and_return(authy_response)
|
142
142
|
|
143
143
|
post :POST_disable_authy
|
144
144
|
@user.reload
|
data/spec/rails-app/Gemfile.lock
CHANGED