devise-authy 1.8.2 → 1.8.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
  SHA256:
3
- metadata.gz: b4a21e73c3efd8c4368a9685a1034a6dd43028949d6427309ee0ebd646d5c147
4
- data.tar.gz: a3eaac986e7eb6620333bd9a6ea21d5aaa4ec58983a92cd1bc3650f2e02c3fe5
3
+ metadata.gz: dfe2b507c6ec983ff3cf4cc7d3410eaacb77dc89ec35ae819047155629ce5807
4
+ data.tar.gz: c1d8b34ecf10a707e492c06782fa5bd8b75a620d9524f601d9ba7e0baf7e291b
5
5
  SHA512:
6
- metadata.gz: 100a286438cc5befc4c02249aff14c68fde76ad20a05f8ec740241e54b92c797abce24d3aacb449fca1c2de31c5320d4d5914b47be8de39b5a23cab5520b836b
7
- data.tar.gz: 8c958b9a2d7b852917df7a130f25b62325783f5e31e2a800a7755428dddf2a3ec573d82d89e164011ac3f99e3a1b1fa76a701e66e8d9f94a1dd5bf4ee77bfb31
6
+ metadata.gz: b81fc8c513a5ffe555baa28535a227ad4e1428ea15e5b5a9bcea461b7c18eb8cd05a8a27d3ee5c30ee04a06f0c5a08c9483e660199ed6123e9f369a16b277bb5
7
+ data.tar.gz: a91cb3e6d2c093d9884de68394d1101e036d3a76ab8d54d340037882ab23ae278c8e0dbd2ff773be84ce47299db0629f190eb248e333e6c921f5001274d9f022
@@ -1,4 +1,12 @@
1
1
  language: ruby
2
+ before_install: cd spec/rails-app && bundle install
3
+ script: bundle exec rspec
2
4
  rvm:
3
- - 2.3.0
4
- - 2.2.3
5
+ - 2.5
6
+ - 2.4
7
+ - 2.3
8
+ - 2.2
9
+ - ruby-head
10
+ matrix:
11
+ allow_failures:
12
+ - rvm: ruby-head
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.8.3] - 2018-07-05
11
+ ### Fixed
12
+ - Fixes Ruby interpolation in HAML for onetouch (thanks @muan)
13
+ - Records Authy authentication after install verification (thanks @nukturnal)
14
+ - Forgets remember device cookie when disabling Authy (thanks @senekis)
15
+
16
+ ### Changed
17
+ - Updated testing Rubies in CI
18
+
19
+ ## Older releases
20
+
21
+ __*The following releases happened before the changelog was started. Some history will be added for clarity.*__
22
+
23
+ ## [1.8.2] - 2017-12-22
24
+ ## [1.8.1] - 2016-12-06
25
+ ## [1.8.0] - 2016-10-25
26
+ ## [1.7.0] - 2015-12-22
27
+ ## [1.6.0] - 2015-01-07
28
+ ## [1.5.3] - 2014-06-11
29
+ ## [1.5.2] - 2014-06-11
30
+ ## [1.5.1] - 2014-04-24
31
+ ## [1.5.0] - 2014-01-07
32
+ ## [1.4.0] - 2013-12-17
33
+ ## [1.3.0] - 2013-11-16
34
+ ## [1.2.2] - 2013-09-04
35
+ ## [1.2.1] - 2013-04-22
36
+ ## [1.2.0] - 2013-04-22 [YANKED]
37
+ ## [1.0.0] - 2013-04-10
38
+
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Authy Devise
1
+ # Authy Devise [![Build Status](https://travis-ci.org/authy/authy-devise.svg?branch=master)](https://travis-ci.org/authy/authy-devise)
2
2
 
3
3
  This is a [Devise](https://github.com/plataformatec/devise) extension to add Two-Factor Authentication with Authy to your rails application.
4
4
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.2
1
+ 1.8.3
@@ -81,6 +81,7 @@ class Devise::DeviseAuthyController < DeviseController
81
81
  if response.ok?
82
82
  resource.update_attribute(:authy_enabled, false)
83
83
  resource.update_attribute(:authy_id, nil)
84
+ forget_device
84
85
 
85
86
  set_flash_message(:notice, :disabled)
86
87
  else
@@ -104,13 +105,14 @@ class Devise::DeviseAuthyController < DeviseController
104
105
  self.resource.authy_enabled = token.ok?
105
106
 
106
107
  if token.ok? && self.resource.save
108
+ record_authy_authentication
107
109
  set_flash_message(:notice, :enabled)
108
110
  redirect_to after_authy_verified_path_for(resource)
109
111
  else
110
112
  handle_invalid_token :verify_authy_installation, :not_enabled
111
113
  end
112
114
  end
113
-
115
+
114
116
  def GET_authy_onetouch_status
115
117
  status = Authy::API.get_request("onetouch/json/approval_requests/#{params[:onetouch_uuid]}")['approval_request']['status']
116
118
  case status
@@ -26,7 +26,7 @@
26
26
  if(this.status != 202) clearInterval(onetouchInterval);
27
27
  if(this.status == 200) window.location = JSON.parse(this.responseText).redirect;
28
28
  });
29
- onetouchRequest.open("GET", "<%= polymorphic_path [resource_name, :authy_onetouch_status] %>?onetouch_uuid=<%= @onetouch_uuid %>");
29
+ onetouchRequest.open("GET", "#{polymorphic_path [resource_name, :authy_onetouch_status]}?onetouch_uuid=#{@onetouch_uuid}");
30
30
  onetouchRequest.send();
31
31
  }, 3000);
32
32
  })();
@@ -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.8.2 ruby lib
5
+ # stub: devise-authy 1.8.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "devise-authy".freeze
9
- s.version = "1.8.2"
9
+ s.version = "1.8.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Authy Inc.".freeze]
14
- s.date = "2017-12-22"
14
+ s.date = "2018-07-05"
15
15
  s.description = "Authy plugin for Devise".freeze
16
16
  s.email = "support@authy.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  ".document",
23
23
  ".rspec",
24
24
  ".travis.yml",
25
+ "CHANGELOG.md",
25
26
  "Gemfile",
26
27
  "LICENSE.txt",
27
28
  "README.md",
@@ -200,7 +201,7 @@ Gem::Specification.new do |s|
200
201
  ]
201
202
  s.homepage = "https://github.com/authy/authy-devise".freeze
202
203
  s.licenses = ["MIT".freeze]
203
- s.rubygems_version = "2.7.3".freeze
204
+ s.rubygems_version = "2.7.6".freeze
204
205
  s.summary = "Authy plugin for Devise".freeze
205
206
 
206
207
  if s.respond_to? :specification_version then
@@ -8,6 +8,7 @@ module DeviseAuthy
8
8
  end
9
9
 
10
10
  private
11
+
11
12
  def remember_device
12
13
  id = @resource.id
13
14
  cookies.signed[:remember_device] = {
@@ -17,6 +18,10 @@ module DeviseAuthy
17
18
  }
18
19
  end
19
20
 
21
+ def forget_device
22
+ cookies.delete :remember_device
23
+ end
24
+
20
25
  def require_token?
21
26
  id = warden.session(resource_name)[:id]
22
27
  cookie = cookies.signed[:remember_device]
@@ -193,7 +193,15 @@ describe Devise::DeviseAuthyController, type: :controller do
193
193
  sign_in @user
194
194
  @user.update_attribute(:authy_enabled, true)
195
195
 
196
+ request.cookies["remember_device"] = {
197
+ :value => {expires: Time.now.to_i, id: @user.id}.to_json,
198
+ :secure => false,
199
+ :expires => User.authy_remember_device.from_now
200
+ }
201
+
196
202
  post :POST_disable_authy
203
+
204
+ expect(response.cookies["remember_device"]).to be_nil
197
205
  @user.reload
198
206
  expect(@user.authy_id).to be_nil
199
207
  expect(@user.authy_enabled).to be_falsey
@@ -239,6 +247,7 @@ describe Devise::DeviseAuthyController, type: :controller do
239
247
  it "Should enable authy for user" do
240
248
  sign_in @user
241
249
  post :POST_verify_authy_installation, :token => "0000000"
250
+ expect(session["user_authy_token_checked"]).to be_truthy
242
251
  expect(response).to redirect_to(root_url)
243
252
  expect(flash[:notice]).to eq('Two factor authentication was enabled')
244
253
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-authy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Authy Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-22 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -147,6 +147,7 @@ files:
147
147
  - ".document"
148
148
  - ".rspec"
149
149
  - ".travis.yml"
150
+ - CHANGELOG.md
150
151
  - Gemfile
151
152
  - LICENSE.txt
152
153
  - README.md
@@ -342,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
343
  version: '0'
343
344
  requirements: []
344
345
  rubyforge_project:
345
- rubygems_version: 2.7.3
346
+ rubygems_version: 2.7.6
346
347
  signing_key:
347
348
  specification_version: 4
348
349
  summary: Authy plugin for Devise