devise_google_authenticator 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +3 -1
- data/lib/devise_google_authenticatable/controllers/helpers.rb +9 -3
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODhhMWQ5M2IxNzA4MGFhYzAzMTE2ZGIyMmZhOTIwOWFkOGQyNjBmNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDkwNGI3MjgxM2UyZmZlNzAyNGIzNWRiMjhlMmEzMTcyOTRiMjZmOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2E1YjM1ZmMwNmNiZjI4NGUwNjI1MGIxOTNlZmE0NzExMjAyNWRjNTIxNzIy
|
10
|
+
NTk3ZTAyMGFjYmY4Y2UyYWQyYmQxNzcyM2NlMWZjYmIwNTY1NzRkMDliNjBl
|
11
|
+
Yzc4OWYyZDZlOTE3ZjUwMjJjNmY5NjFlOGY3ZTliOTk0MmRiMDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTNlNjRiZGUzNTg3YTRiNDZiMDQzZDAyYWE2NDEyMjY0ZmVhZTI0NDhhY2U2
|
14
|
+
OTdiZjk1OGUyYWM2OTRjMmFmY2I1NTFjZmVmZWUwNDVjMTEyOGFlOGU0OTkx
|
15
|
+
YTYxNTdkNmNmZDJjZTg5Y2Y0NDdiZDBkYzM1MWQ1MmZkZDM4MjU=
|
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.13'
|
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.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.
|
82
83
|
* Version 0.3.12 - Re-introduced Warden's after_authentication callback. Thanks Sunny Ng for the pull.
|
83
84
|
* 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
|
84
85
|
* Version 0.3.10 - Added support for Mongoid ORM in addition to ActiveRecord. (Still no appropriate testing for, but I've run this on vanilla Rails 4.0.4 and Devise 3.2.3 apps)
|
@@ -105,6 +106,7 @@ This extension would not exist without the following other projects and associat
|
|
105
106
|
* Devise_security_extension (Team Phatworx, Marco Scholl, Alexander Dreher) https://github.com/phatworx/devise_security_extension
|
106
107
|
* Ronald Arias https://github.com/ronald05arias
|
107
108
|
* Sunny Ng https://github.com/blahblahblah-
|
109
|
+
* Michael Guymon https://github.com/mguymon
|
108
110
|
|
109
111
|
|
110
112
|
== Contributing to devise_google_authenticator
|
@@ -1,17 +1,23 @@
|
|
1
1
|
module DeviseGoogleAuthenticator
|
2
2
|
module Controllers # :nodoc:
|
3
3
|
module Helpers # :nodoc:
|
4
|
-
def google_authenticator_qrcode(user)
|
5
|
-
|
4
|
+
def google_authenticator_qrcode(user,qualifier=nil)
|
5
|
+
username = username_from_email(user.email)
|
6
|
+
app = Rails.application.class.parent_name
|
7
|
+
data = "otpauth://totp/#{otpauth_user(username, app, qualifier)}?secret=#{user.gauth_secret}"
|
6
8
|
data = Rack::Utils.escape(data)
|
7
9
|
url = "https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=#{data}"
|
8
10
|
return image_tag(url, :alt => 'Google Authenticator QRCode')
|
9
11
|
end
|
10
12
|
|
13
|
+
def otpauth_user(username, app, qualifier=nil)
|
14
|
+
"#{username}@#{app}#{qualifier}"
|
15
|
+
end
|
16
|
+
|
11
17
|
def username_from_email(email)
|
12
18
|
(/^(.*)@/).match(email)[1]
|
13
19
|
end
|
14
20
|
|
15
21
|
end
|
16
22
|
end
|
17
|
-
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Frichot
|
@@ -10,20 +10,6 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3.0
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.3.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: railties
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|