authentication-zero 2.3.1 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/authentication_zero/version.rb +1 -1
  4. data/lib/generators/authentication/templates/controllers/api/email_verifications_controller.rb.tt +2 -0
  5. data/lib/generators/authentication/templates/controllers/html/email_verifications_controller.rb.tt +2 -0
  6. data/lib/generators/authentication/templates/erb/identity_mailer/password_reset_provision.html.erb.tt +1 -1
  7. data/lib/generators/authentication/templates/erb/identity_mailer/password_reset_provision.text.erb.tt +1 -1
  8. data/lib/generators/authentication/templates/mailers/identity_mailer.rb.tt +2 -2
  9. data/lib/generators/authentication/templates/migrations/create_sessions_migration.rb.tt +4 -3
  10. data/lib/generators/authentication/templates/migrations/create_table_migration.rb.tt +2 -2
  11. data/lib/generators/authentication/templates/test_unit/controllers/api/email_verifications_controller_test.rb.tt +1 -1
  12. data/lib/generators/authentication/templates/test_unit/controllers/api/emails_controller_test.rb.tt +1 -1
  13. data/lib/generators/authentication/templates/test_unit/controllers/api/passwords_controller_test.rb.tt +1 -1
  14. data/lib/generators/authentication/templates/test_unit/controllers/api/registrations_controller_test.rb.tt +1 -1
  15. data/lib/generators/authentication/templates/test_unit/controllers/api/sessions_controller_test.rb.tt +3 -3
  16. data/lib/generators/authentication/templates/test_unit/controllers/api/sudos_controller_test.rb.tt +1 -1
  17. data/lib/generators/authentication/templates/test_unit/controllers/html/email_verifications_controller_test.rb.tt +1 -1
  18. data/lib/generators/authentication/templates/test_unit/controllers/html/emails_controller_test.rb.tt +1 -1
  19. data/lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt +1 -1
  20. data/lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt +2 -2
  21. data/lib/generators/authentication/templates/test_unit/controllers/html/sessions_controller_test.rb.tt +3 -3
  22. data/lib/generators/authentication/templates/test_unit/controllers/html/sudos_controller_test.rb.tt +1 -1
  23. data/lib/generators/authentication/templates/test_unit/system/sudos_test.rb.tt +1 -1
  24. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de45127fd253c1efc38817d1279aa741ab504e362b219707f15126f6c80180d8
4
- data.tar.gz: 7fa0b3a4dbfb2c2ab3a4eb59f0f681aa9b43edc93ba713d465256e5aa50dc466
3
+ metadata.gz: 70f497dd8ed75e1f18c31ef969a0813537d5f80ac72b178fef396347840fd752
4
+ data.tar.gz: 5d8ab5264ece31d0fe9b14865353bae79d603fac87fcf9417c0dfa58b7c67361
5
5
  SHA512:
6
- metadata.gz: 02a00d183b33d8f262d509d5c61235f68cc0a7c4796e04efafdb8a60154baedfeb8d5b6057ec41cb64537ec6fdcf42ac3e71edeac0d8101ceaa32148a65ec29d
7
- data.tar.gz: 93f9d71f746da6de64e9d4059ec672e63ccaacbabed082f4e5118c658f9173670f729c5ffa01518431d5b40f545dc8288c252e96470cd9fea320dfbb16eae6d1
6
+ metadata.gz: 3d7ed564b16eba4c19fd2a107b8b8e5e256a2b8d7203130c0b1c4c6dac802503bef8c5a98fac02053a20660ab11f5cc2b39f0fc0d46d2fbe8720cd385573adf5
7
+ data.tar.gz: f9214fcb6e2653acd3dc4687992142848cd1e6a71cb050a1fa1ea02d2f57ec672b346d4ab234027bb37b170a20cdbce4d8d63adac81894b4b06519fefab1a060
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.3.1)
4
+ authentication-zero (2.3.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.4"
3
3
  end
@@ -1,4 +1,6 @@
1
1
  class EmailVerificationsController < ApplicationController
2
+ skip_before_action :authenticate, only: :edit
3
+
2
4
  before_action :set_<%= singular_table_name %>, only: :edit
3
5
 
4
6
  def edit
@@ -1,4 +1,6 @@
1
1
  class EmailVerificationsController < ApplicationController
2
+ skip_before_action :authenticate, only: :edit
3
+
2
4
  before_action :set_<%= singular_table_name %>, only: :edit
3
5
 
4
6
  def edit
@@ -1,6 +1,6 @@
1
1
  <p>Hey there,</p>
2
2
 
3
- <p>Can't remember your password for <strong><%%= @session.<%= singular_table_name %>.email %></strong>? That's OK, it happens. Just hit the link below to set a new one.</p>
3
+ <p>Can't remember your password for <strong><%%= @<%= singular_table_name %>.email %></strong>? That's OK, it happens. Just hit the link below to set a new one.</p>
4
4
 
5
5
  <p><%%= link_to "Reset my password", edit_password_reset_url(token: @signed_id) %></p>
6
6
 
@@ -1,6 +1,6 @@
1
1
  Hey there,
2
2
 
3
- Can't remember your password for <%%= @session.<%= singular_table_name %>.email %>? That's OK, it happens. Just hit the link below to set a new one.
3
+ Can't remember your password for <%%= @<%= singular_table_name %>.email %>? That's OK, it happens. Just hit the link below to set a new one.
4
4
 
5
5
  [Reset my password]<%%= edit_password_reset_url(token: @signed_id) %>
6
6
 
@@ -1,14 +1,14 @@
1
1
  class IdentityMailer < ApplicationMailer
2
2
  def password_reset_provision
3
3
  @<%= singular_table_name %> = params[:<%= singular_table_name %>]
4
- @signed_id = params[:<%= singular_table_name %>].signed_id(purpose: :password_reset, expires_in: 20.minutes)
4
+ @signed_id = @<%= singular_table_name %>.signed_id(purpose: :password_reset, expires_in: 20.minutes)
5
5
 
6
6
  mail to: @<%= singular_table_name %>.email, subject: "Reset your password"
7
7
  end
8
8
 
9
9
  def email_verify_confirmation
10
10
  @<%= singular_table_name %> = params[:<%= singular_table_name %>]
11
- @signed_id = params[:<%= singular_table_name %>].signed_id(purpose: @<%= singular_table_name %>.email, expires_in: 20.minutes)
11
+ @signed_id = @<%= singular_table_name %>.signed_id(purpose: @<%= singular_table_name %>.email, expires_in: 20.minutes)
12
12
 
13
13
  mail to: @<%= singular_table_name %>.email, subject: "Verify your email"
14
14
  end
@@ -1,9 +1,10 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :sessions do |t|
4
- t.references :<%= singular_table_name %>, null: false, foreign_key: true
5
- t.string :user_agent
6
- t.string :ip_address
4
+ t.references :user, null: false, foreign_key: true
5
+
6
+ t.string :user_agent, null: false
7
+ t.string :ip_address, null: false
7
8
 
8
9
  t.datetime :sudo_at, null: false
9
10
 
@@ -1,10 +1,10 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :<%= table_name %> do |t|
4
- t.string :email, null: false
4
+ t.string :email, null: false
5
5
  t.string :password_digest, null: false
6
6
 
7
- t.boolean :verified, default: false
7
+ t.boolean :verified, null: false, default: false
8
8
 
9
9
  t.timestamps
10
10
  end
@@ -39,6 +39,6 @@ class EmailVerificationsControllerTest < ActionDispatch::IntegrationTest
39
39
  end
40
40
 
41
41
  def sign_in_as(<%= singular_table_name %>)
42
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
42
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
43
43
  end
44
44
  end
@@ -20,6 +20,6 @@ class EmailsControllerTest < ActionDispatch::IntegrationTest
20
20
  end
21
21
 
22
22
  def sign_in_as(<%= singular_table_name %>)
23
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
23
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
24
24
  end
25
25
  end
@@ -18,6 +18,6 @@ class PasswordsControllerTest < ActionDispatch::IntegrationTest
18
18
  end
19
19
 
20
20
  def sign_in_as(<%= singular_table_name %>)
21
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
21
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
22
22
  end
23
23
  end
@@ -20,6 +20,6 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
20
20
  end
21
21
 
22
22
  def sign_in_as(<%= singular_table_name %>)
23
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
23
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
24
24
  end
25
25
  end
@@ -16,14 +16,14 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
16
16
  end
17
17
 
18
18
  test "should sign in" do
19
- post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "Secret123456" }
19
+ post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }
20
20
 
21
21
  assert_enqueued_email_with SessionMailer, :signed_in_notification, args: { session: @<%= singular_table_name %>.sessions.last }
22
22
  assert_response :created
23
23
  end
24
24
 
25
25
  test "should not sign in with wrong credentials" do
26
- post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "SecretWrong123" }
26
+ post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "SecretWrong123" }, headers: { "User-Agent" => "App iOS" }
27
27
  assert_response :unauthorized
28
28
  end
29
29
 
@@ -33,6 +33,6 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
33
33
  end
34
34
 
35
35
  def sign_in_as(<%= singular_table_name %>)
36
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
36
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
37
37
  end
38
38
  end
@@ -19,6 +19,6 @@ class SudosControllerTest < ActionDispatch::IntegrationTest
19
19
  end
20
20
 
21
21
  def sign_in_as(<%= singular_table_name %>)
22
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
22
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "App iOS" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
23
23
  end
24
24
  end
@@ -39,6 +39,6 @@ class EmailVerificationsControllerTest < ActionDispatch::IntegrationTest
39
39
  end
40
40
 
41
41
  def sign_in_as(<%= singular_table_name %>)
42
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); <%= singular_table_name %>
42
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); <%= singular_table_name %>
43
43
  end
44
44
  end
@@ -30,6 +30,6 @@ class EmailsControllerTest < ActionDispatch::IntegrationTest
30
30
  end
31
31
 
32
32
  def sign_in_as(<%= singular_table_name %>)
33
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); <%= singular_table_name %>
33
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); <%= singular_table_name %>
34
34
  end
35
35
  end
@@ -23,6 +23,6 @@ class PasswordsControllerTest < ActionDispatch::IntegrationTest
23
23
  end
24
24
 
25
25
  def sign_in_as(<%= singular_table_name %>)
26
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); <%= singular_table_name %>
26
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); <%= singular_table_name %>
27
27
  end
28
28
  end
@@ -8,7 +8,7 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
8
8
 
9
9
  test "should sign up" do
10
10
  assert_difference("<%= class_name %>.count") do
11
- post sign_up_url, params: { <%= singular_table_name %>: { email: "lazaronixon@hey.com", password: "Secret123456", password_confirmation: "Secret123456" } }
11
+ post sign_up_url, params: { <%= singular_table_name %>: { email: "lazaronixon@hey.com", password: "Secret123456", password_confirmation: "Secret123456" } }, headers: { "User-Agent" => "Firefox" }
12
12
  end
13
13
 
14
14
  assert_redirected_to root_url
@@ -25,6 +25,6 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
25
25
  end
26
26
 
27
27
  def sign_in_as(<%= singular_table_name %>)
28
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); <%= singular_table_name %>
28
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); <%= singular_table_name %>
29
29
  end
30
30
  end
@@ -18,7 +18,7 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
18
18
  end
19
19
 
20
20
  test "should sign in" do
21
- post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "Secret123456" }
21
+ post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }
22
22
  assert_enqueued_email_with SessionMailer, :signed_in_notification, args: { session: @<%= singular_table_name %>.sessions.last }
23
23
 
24
24
  assert_redirected_to root_url
@@ -28,7 +28,7 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
28
28
  end
29
29
 
30
30
  test "should not sign in with wrong credentials" do
31
- post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "SecretWrong123" }
31
+ post sign_in_url, params: { email: @<%= singular_table_name %>.email, password: "SecretWrong123" }, headers: { "User-Agent" => "Firefox" }
32
32
  assert_redirected_to sign_in_url(email_hint: @<%= singular_table_name %>.email)
33
33
  assert_equal "That email or password is incorrect", flash[:alert]
34
34
 
@@ -47,6 +47,6 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
47
47
  end
48
48
 
49
49
  def sign_in_as(<%= singular_table_name %>)
50
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); <%= singular_table_name %>
50
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); <%= singular_table_name %>
51
51
  end
52
52
  end
@@ -21,6 +21,6 @@ class SudosControllerTest < ActionDispatch::IntegrationTest
21
21
  end
22
22
 
23
23
  def sign_in_as(<%= singular_table_name %>)
24
- post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
24
+ post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "Secret123456" }, headers: { "User-Agent" => "Firefox" }); [<%= singular_table_name %>, response.headers["X-Session-Token"]]
25
25
  end
26
26
  end
@@ -10,7 +10,7 @@ class SudosTest < ApplicationSystemTestCase
10
10
  fill_in :password, with: "Secret123456"
11
11
  click_on "Continue"
12
12
 
13
- assert_selector "h1", text: "Enter your password to continue"
13
+ assert_selector "h1", text: "Change your password"
14
14
  end
15
15
 
16
16
  def sign_in_as(<%= singular_table_name %>)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon