devise_google_authenticator 0.3.13 → 0.3.14
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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmRjYzlmZjk0NzUzMzM3ZjMyZGQwZTM2ZmVjNzQ0ODAwYWVlMWViMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDVkYzFlYTczZjNkNWQwZDNiNzJmZDM5YWJmOGZmOTM0YzI2NDE3MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjZjNGJjNTg4YzJkNDAxZDAzNTBmMDQ3ZWU4MjdjYzA1YWIxZWZkY2Q5YTI2
|
10
|
+
NDMyMTFlYWY4NDcwZDJjNDBhMjRhMDY4NmMzN2YzNmJkMWE3Y2I1NjlkMzQ5
|
11
|
+
M2Y4M2NlMzc4YWNmMWYyMWU1NjFkZDMwODc1ZWFmYjkyM2U4NmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDUxYWZhY2I3YTk0YzAxNmVjNzM5YWE3ZWE0NjI4MWZkZmNmNmFkY2QyZjkw
|
14
|
+
MjY4YjJkODZkNzVhYzNjMWQwNjM3ZDQ4YjA2ZjFmYWU2MGZiMmM2MTRmYmE2
|
15
|
+
NThkYjMwNjYwODg5MTE3ZGUyZjY0YjE0ZmIyOTU0MGQ2MDY0YjI=
|
data/README.rdoc
CHANGED
@@ -7,7 +7,7 @@ This is a devise[https://github.com/plataformatec/devise] extension to allow you
|
|
7
7
|
Add the gem to your Gemfile (don't forget devise too):
|
8
8
|
|
9
9
|
* gem 'devise'
|
10
|
-
* gem 'devise_google_authenticator', '0.3.
|
10
|
+
* gem 'devise_google_authenticator', '0.3.14'
|
11
11
|
|
12
12
|
Don't forget to "bundle install"
|
13
13
|
|
@@ -79,6 +79,7 @@ With this extension enabled, the following is expected behaviour:
|
|
79
79
|
The install generator also installs an english copy of a Devise Google Authenticator i18n file. This can be modified (or used to create other language versions) and is located at: config/locales/devise.google_authenticator.en.yml
|
80
80
|
|
81
81
|
== Changes
|
82
|
+
* Version 0.3.14 - Users can now generate a new token if they wish. This is available from the displayqr page.
|
82
83
|
* Version 0.3.13 - Merged a feature to allow a qualifier for the Google Authenticator token display. This allows you to specify in your view a qualifier for the name of the OTP when it's enrolled into the Google Authenticator app. Thanks Michael Guymon for the pull.
|
83
84
|
* Version 0.3.12 - Re-introduced Warden's after_authentication callback. Thanks Sunny Ng for the pull.
|
84
85
|
* Version 0.3.11 - Fixed a bug where if the Devise module was included within something else, such as Active Admin, rewriting back to the CheckGA functionality was broken. This update addresses https://github.com/AsteriskLabs/devise_google_authenticator/issues/7
|
@@ -1,8 +1,9 @@
|
|
1
1
|
class Devise::DisplayqrController < DeviseController
|
2
|
-
prepend_before_filter :authenticate_scope!, :only => [:show,:update]
|
2
|
+
prepend_before_filter :authenticate_scope!, :only => [:show,:update,:refresh]
|
3
3
|
|
4
4
|
include Devise::Controllers::Helpers
|
5
5
|
|
6
|
+
# GET /resource/displayqr
|
6
7
|
def show
|
7
8
|
if resource.nil? || resource.gauth_secret.nil?
|
8
9
|
sign_in scope, resource, :bypass => true
|
@@ -22,6 +23,18 @@ class Devise::DisplayqrController < DeviseController
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
26
|
+
def refresh
|
27
|
+
unless resource.nil?
|
28
|
+
resource.send(:assign_auth_secret)
|
29
|
+
resource.save
|
30
|
+
set_flash_message :notice, :newtoken
|
31
|
+
sign_in scope, resource, :bypass => true
|
32
|
+
redirect_to [resource_name, :displayqr]
|
33
|
+
else
|
34
|
+
redirect_to :root
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
25
38
|
private
|
26
39
|
def scope
|
27
40
|
resource_name.to_sym
|
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
<%= google_authenticator_qrcode(resource) %>
|
4
4
|
|
5
|
+
<%= form_for(resource, :as => resource_name, :url => [:refresh, resource_name, :displayqr], :html => {:method => :post}) do |f|%>
|
6
|
+
<p><%= f.submit I18n.t('newtoken', {:scope => 'devise.registration'}) %></p>
|
7
|
+
<% end %>
|
8
|
+
|
5
9
|
<%= form_for(resource, :as => resource_name, :url => [resource_name, :displayqr], :html => { :method => :put }) do |f| %>
|
6
10
|
<%= devise_error_messages! %>
|
7
11
|
<h3><%= I18n.t('nice_request', {:scope => 'devise.registration'}) %></h3>
|
@@ -9,4 +13,5 @@
|
|
9
13
|
<%= f.check_box :gauth_enabled %></p>
|
10
14
|
|
11
15
|
<p><%= f.submit I18n.t('submit', {:scope => 'devise.registration'}) %></p>
|
12
|
-
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
data/config/locales/en.yml
CHANGED
@@ -7,6 +7,7 @@ en:
|
|
7
7
|
nice_request: "Would you like to enable Google Authenticator?"
|
8
8
|
qrstatus: "Google Authenticator Status:"
|
9
9
|
submit: "Continue..."
|
10
|
+
newtoken: "Generate new token"
|
10
11
|
checkga:
|
11
12
|
user:
|
12
13
|
signed_in: "Signed in successfully from token."
|
@@ -14,3 +15,4 @@ en:
|
|
14
15
|
displayqr:
|
15
16
|
user:
|
16
17
|
status: "User status updated!"
|
18
|
+
newtoken: "You have updated to a new token - make sure you update your Google Authenticator application before continuing!!"
|
@@ -5,7 +5,9 @@ module ActionDispatch::Routing # :nodoc:
|
|
5
5
|
|
6
6
|
# route for handle expired passwords
|
7
7
|
def devise_displayqr(mapping, controllers)
|
8
|
-
resource :displayqr, :only => [:show, :update], :path => mapping.path_names[:displayqr], :controller => controllers[:displayqr]
|
8
|
+
resource :displayqr, :only => [:show, :update], :path => mapping.path_names[:displayqr], :controller => controllers[:displayqr] do
|
9
|
+
post :refresh, :path => mapping.path_names[:refresh], :as => :refresh
|
10
|
+
end
|
9
11
|
resource :checkga, :only => [:show, :update], :path => mapping.path_names[:checkga], :controller => controllers[:checkga]
|
10
12
|
end
|
11
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_google_authenticator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Frichot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|