authentication-zero 1.0.1 → 1.0.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/authentication_zero/version.rb +1 -1
- data/lib/generators/authentication/authentication_generator.rb +2 -2
- data/lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt +1 -1
- data/lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt +1 -1
- data/lib/generators/authentication/templates/erb/password_resets/new.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/test_unit/controllers/api/password_resets_controller_test.rb.tt +1 -2
- data/lib/generators/authentication/templates/test_unit/controllers/html/password_resets_controller_test.rb.tt +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c038ff0229826dcb0ef7416e95f41ef7e18a01a7e5993a3995eb992c2a21a44a
|
4
|
+
data.tar.gz: 6295fb855b41a0ea8242916c18c40686f41d6f32e83fe66ed8922fe3b2c24ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbbbb3287c24e23260ca3ad7adcc206c864f02843c255c111b6c1f06fd822581db35c522358dfa60a626e83bb2eb0f8494274847185a122f9cd90726c94ae2cf
|
7
|
+
data.tar.gz: fb427adb9595073f03b76bba0683cafd5ce9a699b25d79bbd4df2902abc7f4643f326a4b25c017ce6ab98b7e21d69d0532539aaeec8a018c3d69b7fd597f4d81
|
data/Gemfile.lock
CHANGED
@@ -74,8 +74,8 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
|
|
74
74
|
|
75
75
|
def create_views
|
76
76
|
if options.api
|
77
|
-
directory "
|
78
|
-
directory "
|
77
|
+
directory "erb/email_mailer", "app/views/email_mailer"
|
78
|
+
directory "erb/password_mailer", "app/views/password_mailer"
|
79
79
|
else
|
80
80
|
directory "#{template_engine}", "app/views"
|
81
81
|
end
|
data/lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt
CHANGED
@@ -11,7 +11,7 @@ class PasswordResetsController < ApplicationController
|
|
11
11
|
if @<%= singular_table_name %> = <%= class_name %>.find_by_email(params[:email])
|
12
12
|
PasswordMailer.with(<%= singular_table_name %>: @<%= singular_table_name %>).reset.deliver_later
|
13
13
|
else
|
14
|
-
render json: { error: "
|
14
|
+
render json: { error: "Sorry, we didn't recognize that email address" }, status: :not_found
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt
CHANGED
@@ -14,7 +14,7 @@ class PasswordResetsController < ApplicationController
|
|
14
14
|
PasswordMailer.with(<%= singular_table_name %>: @<%= singular_table_name %>).reset.deliver_later
|
15
15
|
redirect_to sign_in_path, notice: "You will receive an email with instructions on how to reset your password in a few minutes"
|
16
16
|
else
|
17
|
-
redirect_to new_password_resets_path
|
17
|
+
redirect_to new_password_resets_path, alert: "Sorry, we didn't recognize that email address"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<%%= form_with(url: password_resets_path) do |form| %>
|
6
6
|
<div>
|
7
7
|
<%%= form.label :email, style: "display: block" %>
|
8
|
-
<%%= form.email_field :email,
|
8
|
+
<%%= form.email_field :email, autofocus: true, required: true %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div>
|
@@ -28,12 +28,11 @@ class PasswordResetsControllerTest < ActionDispatch::IntegrationTest
|
|
28
28
|
end
|
29
29
|
|
30
30
|
assert_response :not_found
|
31
|
-
assert_equal "
|
31
|
+
assert_equal "Sorry, we didn't recognize that email address", response.parsed_body["error"]
|
32
32
|
end
|
33
33
|
|
34
34
|
test "should update password" do
|
35
35
|
patch password_resets_url, params: { token: @sid, password: "new_password", password_confirmation: "new_password" }
|
36
|
-
|
37
36
|
assert_response :success
|
38
37
|
end
|
39
38
|
|
@@ -30,13 +30,12 @@ class PasswordResetsControllerTest < ActionDispatch::IntegrationTest
|
|
30
30
|
post password_resets_url, params: { email: "invalid_email@hey.com" }
|
31
31
|
end
|
32
32
|
|
33
|
-
assert_redirected_to new_password_resets_url
|
34
|
-
assert_equal "
|
33
|
+
assert_redirected_to new_password_resets_url
|
34
|
+
assert_equal "Sorry, we didn't recognize that email address", flash[:alert]
|
35
35
|
end
|
36
36
|
|
37
37
|
test "should update password" do
|
38
38
|
patch password_resets_url, params: { token: @sid, <%= singular_table_name %>: { password: "new_password", password_confirmation: "new_password" } }
|
39
|
-
|
40
39
|
assert_redirected_to sign_in_path
|
41
40
|
end
|
42
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authentication-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|