devise-authy 1.0.0 → 1.2.1
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.
- data/Gemfile +3 -1
- data/Gemfile.lock +90 -62
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/app/controllers/devise/devise_authy_controller.rb +23 -5
- data/app/views/devise/enable_authy.html.erb +2 -3
- data/app/views/devise/enable_authy.html.haml +2 -5
- data/app/views/devise/verify_authy.html.erb +5 -0
- data/app/views/devise/verify_authy.html.haml +3 -0
- data/authy-devise-demo/Gemfile +1 -0
- data/authy-devise-demo/Gemfile.lock +12 -3
- data/authy-devise-demo/app/views/devise/devise_authy/enable_authy.html.erb +2 -3
- data/authy-devise-demo/app/views/devise/devise_authy/verify_authy.html.erb +5 -0
- data/authy-devise-demo/app/views/layouts/application.html.erb +14 -2
- data/authy-devise-demo/config/initializers/devise.rb +7 -2
- data/authy-devise-demo/config/locales/devise.authy.en.yml +4 -1
- data/config/locales/en.yml +4 -1
- data/devise-authy.gemspec +62 -51
- data/lib/devise-authy.rb +3 -0
- data/lib/devise-authy/controllers/helpers.rb +40 -17
- data/lib/devise-authy/models/authy_authenticatable.rb +2 -0
- data/lib/generators/devise_authy/install_generator.rb +10 -3
- data/spec/controllers/devise_authy_controller_spec.rb +134 -45
- data/spec/features/authy_authenticatable_spec.rb +95 -0
- data/spec/generators_spec.rb +12 -6
- data/spec/orm/active_record.rb +1 -1
- data/spec/rails-app/Gemfile +8 -0
- data/spec/rails-app/Gemfile.lock +111 -0
- data/spec/{rails_app → rails-app}/Rakefile +2 -5
- data/spec/{rails_app → rails-app}/app/assets/images/rails.png +0 -0
- data/spec/rails-app/app/assets/javascripts/application.js +15 -0
- data/spec/rails-app/app/assets/javascripts/devise_authy.js +7 -0
- data/spec/rails-app/app/assets/javascripts/welcome.js +2 -0
- data/spec/rails-app/app/assets/stylesheets/application.css +13 -0
- data/spec/{rails_app → rails-app}/app/assets/stylesheets/devise_authy.css +0 -0
- data/spec/rails-app/app/assets/stylesheets/welcome.css.scss +3 -0
- data/spec/{rails_app → rails-app}/app/controllers/application_controller.rb +0 -1
- data/spec/rails-app/app/controllers/welcome_controller.rb +6 -0
- data/spec/{rails_app → rails-app}/app/helpers/application_helper.rb +0 -0
- data/spec/rails-app/app/helpers/welcome_helper.rb +2 -0
- data/spec/{rails_app → rails-app}/app/mailers/.gitkeep +0 -0
- data/spec/{rails_app → rails-app}/app/models/.gitkeep +0 -0
- data/spec/{rails_app → rails-app}/app/models/user.rb +4 -2
- data/spec/{rails_app/app/views/devise/devise_authy/register.html.erb → rails-app/app/views/devise/devise_authy/enable_authy.html.erb} +4 -6
- data/spec/rails-app/app/views/devise/devise_authy/verify_authy.html.erb +13 -0
- data/spec/rails-app/app/views/devise/devise_authy/verify_authy_installation.html.erb +10 -0
- data/spec/rails-app/app/views/layouts/application.html.erb +29 -0
- data/spec/rails-app/app/views/welcome/index.html.erb +5 -0
- data/spec/{rails_app → rails-app}/config.ru +0 -0
- data/spec/{rails_app → rails-app}/config/application.rb +18 -2
- data/spec/rails-app/config/boot.rb +6 -0
- data/spec/{rails_app → rails-app}/config/database.yml +6 -3
- data/spec/{rails_app → rails-app}/config/environment.rb +0 -0
- data/spec/{rails_app → rails-app}/config/environments/development.rb +2 -0
- data/spec/{rails_app → rails-app}/config/environments/production.rb +0 -0
- data/spec/{rails_app → rails-app}/config/environments/test.rb +0 -0
- data/spec/rails-app/config/initializers/authy.rb +2 -0
- data/spec/{rails_app → rails-app}/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/{rails_app → rails-app}/config/initializers/devise.rb +13 -5
- data/spec/{rails_app → rails-app}/config/initializers/inflections.rb +5 -0
- data/spec/{rails_app → rails-app}/config/initializers/mime_types.rb +0 -0
- data/spec/{rails_app → rails-app}/config/initializers/secret_token.rb +1 -1
- data/spec/{rails_app → rails-app}/config/initializers/session_store.rb +2 -2
- data/spec/{rails_app → rails-app}/config/initializers/wrap_parameters.rb +0 -0
- data/spec/{rails_app → rails-app}/config/locales/devise.authy.en.yml +7 -2
- data/spec/rails-app/config/locales/devise.en.yml +59 -0
- data/spec/rails-app/config/locales/en.yml +5 -0
- data/spec/{rails_app → rails-app}/config/routes.rb +3 -2
- data/spec/rails-app/db/development.sqlite3 +0 -0
- data/spec/{rails_app/db/migrate/20121029205626_devise_create_users.rb → rails-app/db/migrate/20130419164907_devise_create_users.rb} +15 -1
- data/spec/{rails_app/db/migrate/20121029205628_devise_authy_add_to_users.rb → rails-app/db/migrate/20130419164936_devise_authy_add_to_users.rb} +5 -2
- data/spec/{rails_app → rails-app}/db/schema.rb +7 -12
- data/spec/rails-app/db/seeds.rb +7 -0
- data/spec/rails-app/lib/assets/.gitkeep +0 -0
- data/spec/rails-app/lib/tasks/.gitkeep +0 -0
- data/spec/rails-app/public/404.html +26 -0
- data/spec/rails-app/public/422.html +26 -0
- data/spec/rails-app/public/500.html +25 -0
- data/spec/rails-app/public/favicon.ico +0 -0
- data/spec/rails-app/public/robots.txt +5 -0
- data/spec/{rails_app → rails-app}/script/rails +0 -0
- data/spec/routing/routes_spec.rb +20 -8
- data/spec/spec_helper.rb +1 -2
- data/spec/support/helpers.rb +6 -1
- metadata +86 -62
- data/spec/integration/authy_authenticatable.rb +0 -88
- data/spec/rails_app/app/assets/javascripts/application.js +0 -10
- data/spec/rails_app/app/assets/stylesheets/application.css +0 -9
- data/spec/rails_app/app/assets/stylesheets/devise_authy.css.scss +0 -26
- data/spec/rails_app/app/assets/stylesheets/scaffolds.css.scss +0 -56
- data/spec/rails_app/app/controllers/posts_controller.rb +0 -83
- data/spec/rails_app/app/helpers/posts_helper.rb +0 -2
- data/spec/rails_app/app/models/post.rb +0 -2
- data/spec/rails_app/app/views/devise/devise_authy/show.html.erb +0 -10
- data/spec/rails_app/app/views/layouts/application.html.erb +0 -24
- data/spec/rails_app/app/views/posts/_form.html.erb +0 -25
- data/spec/rails_app/app/views/posts/edit.html.erb +0 -6
- data/spec/rails_app/app/views/posts/index.html.erb +0 -27
- data/spec/rails_app/app/views/posts/new.html.erb +0 -5
- data/spec/rails_app/app/views/posts/show.html.erb +0 -15
- data/spec/rails_app/config/boot.rb +0 -7
- data/spec/rails_app/config/initializers/authy.rb +0 -3
- data/spec/rails_app/db/migrate/20121029205627_create_posts.rb +0 -10
- data/spec/rails_app/public/favicon.ico +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Authy Autnenticatable", :type => :request do
|
|
4
|
+
describe "If user don't have two factor authentication should login with email - password" do
|
|
5
|
+
before :each do
|
|
6
|
+
@user = create_user(:email => 'foo@bar.com')
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "Sign in should succeed" do
|
|
10
|
+
fill_sign_in_form('foo@bar.com', '12345678')
|
|
11
|
+
current_path.should == root_path
|
|
12
|
+
page.should have_content('Signed in successfully.')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "Sign in shouldn't success" do
|
|
16
|
+
fill_sign_in_form('foo@bar.com', '14567823')
|
|
17
|
+
current_path.should == new_user_session_path
|
|
18
|
+
page.should_not have_content('Signed in successfully.')
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe "If user have two factor authentication" do
|
|
23
|
+
before :each do
|
|
24
|
+
@user = create_user(:authy_id => 2)
|
|
25
|
+
@user.update_attribute(:authy_enabled, true)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "Sign in should succeed" do
|
|
29
|
+
visit new_user_session_path
|
|
30
|
+
fill_sign_in_form(@user.email, '12345678')
|
|
31
|
+
current_path.should == user_verify_authy_path
|
|
32
|
+
page.should have_content('Please enter your Authy token')
|
|
33
|
+
|
|
34
|
+
within('#devise_authy') do
|
|
35
|
+
fill_in 'authy-token', :with => '0000000'
|
|
36
|
+
end
|
|
37
|
+
click_on 'Check Token'
|
|
38
|
+
current_path.should == root_path
|
|
39
|
+
page.should have_content(I18n.t('devise.devise_authy.user.signed_in'))
|
|
40
|
+
@user.reload
|
|
41
|
+
@user.last_sign_in_with_authy.should_not be_nil
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "Sign in shouldn't succeed" do
|
|
45
|
+
visit new_user_session_path
|
|
46
|
+
fill_sign_in_form(@user.email, '12345678')
|
|
47
|
+
current_path.should == user_verify_authy_path
|
|
48
|
+
page.should have_content('Please enter your Authy token')
|
|
49
|
+
|
|
50
|
+
within('#devise_authy') do
|
|
51
|
+
fill_in 'authy-token', :with => '324567'
|
|
52
|
+
end
|
|
53
|
+
click_on 'Check Token'
|
|
54
|
+
current_path.should == user_verify_authy_path
|
|
55
|
+
@user.reload
|
|
56
|
+
@user.last_sign_in_with_authy.should be_nil
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
describe "With cookie['remember_device']" do
|
|
60
|
+
it "Should prompt for a token" do
|
|
61
|
+
cookie_val = sign_cookie("remember_device", Time.now.to_i - 2.month.to_i)
|
|
62
|
+
page.driver.browser.set_cookie("remember_device=#{cookie_val}")
|
|
63
|
+
visit new_user_session_path
|
|
64
|
+
fill_sign_in_form(@user.email, '12345678')
|
|
65
|
+
current_path.should == user_verify_authy_path
|
|
66
|
+
page.should have_content('Please enter your Authy token')
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it "Shouldn't prompt for a token" do
|
|
70
|
+
cookie_val = sign_cookie("remember_device", Time.now.to_i)
|
|
71
|
+
page.driver.browser.set_cookie("remember_device=#{cookie_val}")
|
|
72
|
+
visit new_user_session_path
|
|
73
|
+
fill_sign_in_form(@user.email, '12345678')
|
|
74
|
+
current_path.should == root_path
|
|
75
|
+
page.should have_content("Signed in successfully.")
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
it "With cookie['current_user_id'] and cookie['user_password_checked']" do
|
|
80
|
+
page.driver.browser.set_cookie("current_user_id=#{@user.id}")
|
|
81
|
+
page.driver.browser.set_cookie('user_password_checked=true')
|
|
82
|
+
|
|
83
|
+
visit user_verify_authy_path
|
|
84
|
+
current_path.should == new_user_session_path
|
|
85
|
+
page.should have_content('Sign in')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it "Click link Request sms" do
|
|
89
|
+
visit new_user_session_path
|
|
90
|
+
fill_sign_in_form(@user.email, '12345678')
|
|
91
|
+
click_link 'Request SMS'
|
|
92
|
+
page.should have_content("SMS token was sent")
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
data/spec/generators_spec.rb
CHANGED
|
@@ -5,20 +5,26 @@ require 'rails/generators'
|
|
|
5
5
|
require 'generators/devise_authy/devise_authy_generator'
|
|
6
6
|
|
|
7
7
|
describe "generators for devise_authy" do
|
|
8
|
-
RAILS_APP_PATH = File.expand_path("../
|
|
8
|
+
RAILS_APP_PATH = File.expand_path("../rails-app", __FILE__)
|
|
9
|
+
|
|
10
|
+
def rails_command(*args)
|
|
11
|
+
`cd #{RAILS_APP_PATH} && BUNDLE_GEMFILE=#{RAILS_APP_PATH}/Gemfile bundle exec rails #{args.join(" ")}`
|
|
12
|
+
end
|
|
9
13
|
|
|
10
14
|
it "rails g should include the generators" do
|
|
11
|
-
@output =
|
|
15
|
+
@output = rails_command("g")
|
|
12
16
|
@output.include?('devise_authy:install').should be_true
|
|
13
17
|
@output.include?('active_record:devise_authy').should be_true
|
|
14
18
|
end
|
|
15
19
|
|
|
16
20
|
it "rails g devise_authy:install" do
|
|
17
|
-
@output =
|
|
21
|
+
@output = rails_command("g", "devise_authy:install", "-s")
|
|
18
22
|
@output.include?('config/initializers/devise.rb').should be_true
|
|
19
23
|
@output.include?('config/locales/devise.authy.en.yml').should be_true
|
|
20
|
-
@output.include?('app/views/devise/devise_authy/
|
|
21
|
-
@output.include?('app/views/devise/devise_authy/
|
|
24
|
+
@output.include?('app/views/devise/devise_authy/enable_authy.html.erb').should be_true
|
|
25
|
+
@output.include?('app/views/devise/devise_authy/verify_authy.html.erb').should be_true
|
|
26
|
+
@output.include?('app/views/devise/devise_authy/verify_authy_installation.html.erb').should be_true
|
|
22
27
|
@output.include?('app/assets/stylesheets/devise_authy.css').should be_true
|
|
28
|
+
@output.include?('app/assets/javascripts/devise_authy.js').should be_true
|
|
23
29
|
end
|
|
24
|
-
end
|
|
30
|
+
end
|
data/spec/orm/active_record.rb
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ../..
|
|
3
|
+
specs:
|
|
4
|
+
devise-authy (1.2.0)
|
|
5
|
+
authy
|
|
6
|
+
devise
|
|
7
|
+
rails (~> 3.2.6)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
actionmailer (3.2.13)
|
|
13
|
+
actionpack (= 3.2.13)
|
|
14
|
+
mail (~> 2.5.3)
|
|
15
|
+
actionpack (3.2.13)
|
|
16
|
+
activemodel (= 3.2.13)
|
|
17
|
+
activesupport (= 3.2.13)
|
|
18
|
+
builder (~> 3.0.0)
|
|
19
|
+
erubis (~> 2.7.0)
|
|
20
|
+
journey (~> 1.0.4)
|
|
21
|
+
rack (~> 1.4.5)
|
|
22
|
+
rack-cache (~> 1.2)
|
|
23
|
+
rack-test (~> 0.6.1)
|
|
24
|
+
sprockets (~> 2.2.1)
|
|
25
|
+
activemodel (3.2.13)
|
|
26
|
+
activesupport (= 3.2.13)
|
|
27
|
+
builder (~> 3.0.0)
|
|
28
|
+
activerecord (3.2.13)
|
|
29
|
+
activemodel (= 3.2.13)
|
|
30
|
+
activesupport (= 3.2.13)
|
|
31
|
+
arel (~> 3.0.2)
|
|
32
|
+
tzinfo (~> 0.3.29)
|
|
33
|
+
activeresource (3.2.13)
|
|
34
|
+
activemodel (= 3.2.13)
|
|
35
|
+
activesupport (= 3.2.13)
|
|
36
|
+
activesupport (3.2.13)
|
|
37
|
+
i18n (= 0.6.1)
|
|
38
|
+
multi_json (~> 1.0)
|
|
39
|
+
arel (3.0.2)
|
|
40
|
+
authy (2.0.1)
|
|
41
|
+
httpclient (>= 2.2.6)
|
|
42
|
+
bcrypt-ruby (3.0.1)
|
|
43
|
+
builder (3.0.4)
|
|
44
|
+
devise (2.2.3)
|
|
45
|
+
bcrypt-ruby (~> 3.0)
|
|
46
|
+
orm_adapter (~> 0.1)
|
|
47
|
+
railties (~> 3.1)
|
|
48
|
+
warden (~> 1.2.1)
|
|
49
|
+
erubis (2.7.0)
|
|
50
|
+
hike (1.2.2)
|
|
51
|
+
httpclient (2.3.3)
|
|
52
|
+
i18n (0.6.1)
|
|
53
|
+
journey (1.0.4)
|
|
54
|
+
json (1.7.7)
|
|
55
|
+
mail (2.5.3)
|
|
56
|
+
i18n (>= 0.4.0)
|
|
57
|
+
mime-types (~> 1.16)
|
|
58
|
+
treetop (~> 1.4.8)
|
|
59
|
+
mime-types (1.22)
|
|
60
|
+
multi_json (1.7.2)
|
|
61
|
+
orm_adapter (0.4.0)
|
|
62
|
+
polyglot (0.3.3)
|
|
63
|
+
rack (1.4.5)
|
|
64
|
+
rack-cache (1.2)
|
|
65
|
+
rack (>= 0.4)
|
|
66
|
+
rack-ssl (1.3.3)
|
|
67
|
+
rack
|
|
68
|
+
rack-test (0.6.2)
|
|
69
|
+
rack (>= 1.0)
|
|
70
|
+
rails (3.2.13)
|
|
71
|
+
actionmailer (= 3.2.13)
|
|
72
|
+
actionpack (= 3.2.13)
|
|
73
|
+
activerecord (= 3.2.13)
|
|
74
|
+
activeresource (= 3.2.13)
|
|
75
|
+
activesupport (= 3.2.13)
|
|
76
|
+
bundler (~> 1.0)
|
|
77
|
+
railties (= 3.2.13)
|
|
78
|
+
railties (3.2.13)
|
|
79
|
+
actionpack (= 3.2.13)
|
|
80
|
+
activesupport (= 3.2.13)
|
|
81
|
+
rack-ssl (~> 1.3.2)
|
|
82
|
+
rake (>= 0.8.7)
|
|
83
|
+
rdoc (~> 3.4)
|
|
84
|
+
thor (>= 0.14.6, < 2.0)
|
|
85
|
+
rake (10.0.4)
|
|
86
|
+
rdoc (3.12.2)
|
|
87
|
+
json (~> 1.4)
|
|
88
|
+
sprockets (2.2.2)
|
|
89
|
+
hike (~> 1.2)
|
|
90
|
+
multi_json (~> 1.0)
|
|
91
|
+
rack (~> 1.0)
|
|
92
|
+
tilt (~> 1.1, != 1.3.0)
|
|
93
|
+
sqlite3 (1.3.7)
|
|
94
|
+
thor (0.18.1)
|
|
95
|
+
tilt (1.3.7)
|
|
96
|
+
treetop (1.4.12)
|
|
97
|
+
polyglot
|
|
98
|
+
polyglot (>= 0.3.1)
|
|
99
|
+
tzinfo (0.3.37)
|
|
100
|
+
warden (1.2.1)
|
|
101
|
+
rack (>= 1.0)
|
|
102
|
+
|
|
103
|
+
PLATFORMS
|
|
104
|
+
ruby
|
|
105
|
+
|
|
106
|
+
DEPENDENCIES
|
|
107
|
+
authy
|
|
108
|
+
devise
|
|
109
|
+
devise-authy!
|
|
110
|
+
rails (~> 3.2.6)
|
|
111
|
+
sqlite3
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
1
2
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
2
3
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
3
4
|
|
|
4
5
|
require File.expand_path('../config/application', __FILE__)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
require 'rake/testtask'
|
|
8
|
-
require 'rdoc/task'
|
|
9
|
-
|
|
10
|
-
Rails.application.load_tasks
|
|
7
|
+
RailsApp::Application.load_tasks
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
+
// listed below.
|
|
3
|
+
//
|
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
+
//
|
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
+
// the compiled file.
|
|
9
|
+
//
|
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
|
12
|
+
//
|
|
13
|
+
//= require jquery
|
|
14
|
+
//= require jquery_ujs
|
|
15
|
+
//= require_tree .
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
|
10
|
+
*
|
|
11
|
+
*= require_self
|
|
12
|
+
*= require_tree .
|
|
13
|
+
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
class User < ActiveRecord::Base
|
|
2
2
|
# Include default devise modules. Others available are:
|
|
3
|
-
# :token_authenticatable, :
|
|
3
|
+
# :token_authenticatable, :confirmable,
|
|
4
|
+
# :lockable, :timeoutable and :omniauthable
|
|
4
5
|
devise :authy_authenticatable, :database_authenticatable, :registerable,
|
|
5
6
|
:recoverable, :rememberable, :trackable, :validatable
|
|
6
7
|
|
|
7
8
|
# Setup accessible (or protected) attributes for your model
|
|
8
|
-
attr_accessible :email, :password, :password_confirmation, :
|
|
9
|
+
attr_accessible :authy_id, :last_sign_in_with_authy, :email, :password, :password_confirmation, :remember_me
|
|
10
|
+
# attr_accessible :authy_id, :last_sign_in_with_authy, :title, :body
|
|
9
11
|
end
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<h2><%= I18n.t('authy_register_title', {:scope => 'devise'}) %></h2>
|
|
2
2
|
|
|
3
|
-
<%=
|
|
4
|
-
|
|
5
|
-
<%= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder =>
|
|
6
|
-
I18n.t('devise.cellphone'), :id => "authy-cellphone"%>
|
|
7
|
-
<%= text_field_tag :country_code, '', :autocomplete => :off, :placeholder =>
|
|
8
|
-
I18n.t('devise.country'), :id => "authy-countries"%>
|
|
3
|
+
<%= enable_authy_form do %>
|
|
4
|
+
<%= text_field_tag :country_code, '', :autocomplete => :off, :placeholder => I18n.t('devise.country'), :id => "authy-countries"%>
|
|
9
5
|
<p><%= submit_tag I18n.t('enable_authy', {:scope => 'devise'}) %></p>
|
|
6
|
+
<%= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder => I18n.t('devise.cellphone'), :id => "authy-cellphone"%>
|
|
10
7
|
<% end %>
|
|
8
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<h2>
|
|
2
|
+
<%= I18n.t('authy_register_title', {:scope => 'devise'}) %>
|
|
3
|
+
</h2>
|
|
4
|
+
|
|
5
|
+
<%= verify_authy_form do %>
|
|
6
|
+
<legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
|
|
7
|
+
<%= label_tag :token %>
|
|
8
|
+
<%= text_field_tag :token, "", :autocomplete => :off, :id => 'authy-token' %>
|
|
9
|
+
<%= link_to '?', '#', :id => 'authy-help' %>
|
|
10
|
+
<%= authy_request_sms_link %>
|
|
11
|
+
<%= submit_tag I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn' %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<h2><%= I18n.t('authy_verify_installation_title', {:scope => 'devise'}) %></h2>
|
|
2
|
+
|
|
3
|
+
<%= verify_authy_installation_form do %>
|
|
4
|
+
<legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
|
|
5
|
+
<%= label_tag :token %>
|
|
6
|
+
<%= text_field_tag :token, "", :autocomplete => :off, :id => 'authy-token' %>
|
|
7
|
+
<%= authy_request_sms_link %>
|
|
8
|
+
<%= submit_tag I18n.t('enable_my_account', {:scope => 'devise'}), :class => 'btn' %>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>RailsApp</title>
|
|
5
|
+
<%= stylesheet_link_tag "application", :media => "all" %>
|
|
6
|
+
<%= javascript_include_tag "application" %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
<%=javascript_include_tag "https://www.authy.com/form.authy.min.js" %>
|
|
9
|
+
<%=stylesheet_link_tag "https://www.authy.com/form.authy.min.css" %>
|
|
10
|
+
<%=javascript_include_tag "devise_authy.js" %>
|
|
11
|
+
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<% if flash[:notice] %>
|
|
15
|
+
<div id="notice">
|
|
16
|
+
<%= flash[:notice] %>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
20
|
+
<% if flash[:error] %>
|
|
21
|
+
<div class='alert alert-error'>
|
|
22
|
+
<%= flash[:error] %>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
25
|
+
|
|
26
|
+
<%= yield %>
|
|
27
|
+
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|