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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 421b9ebae03521494dfa8745a2e06f912635d3f09e34466fcdcf52040564cf7d
4
- data.tar.gz: 155653fd131eccc9aee0aeffb1b859b2b1f34507db60a17c0b337f865502322b
3
+ metadata.gz: c038ff0229826dcb0ef7416e95f41ef7e18a01a7e5993a3995eb992c2a21a44a
4
+ data.tar.gz: 6295fb855b41a0ea8242916c18c40686f41d6f32e83fe66ed8922fe3b2c24ee7
5
5
  SHA512:
6
- metadata.gz: 3bdd61297018da9d527e5c250c8271511bfefb375d01357d81b968eda239940191412b30ac38d89b493780eccdaddba507ebde9df908f6459f358fac10b05ee9
7
- data.tar.gz: 3d916dd8b43f4ecdc7c65660bf5c7f889324672a6d105fe258610b97b64ac1428bc0e8c74d2fa5617161d28b125f73fe156fadfd8fe6ce99136361c3f2ac41b8
6
+ metadata.gz: fbbbb3287c24e23260ca3ad7adcc206c864f02843c255c111b6c1f06fd822581db35c522358dfa60a626e83bb2eb0f8494274847185a122f9cd90726c94ae2cf
7
+ data.tar.gz: fb427adb9595073f03b76bba0683cafd5ce9a699b25d79bbd4df2902abc7f4643f326a4b25c017ce6ab98b7e21d69d0532539aaeec8a018c3d69b7fd597f4d81
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (1.0.1)
4
+ authentication-zero (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -74,8 +74,8 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
74
74
 
75
75
  def create_views
76
76
  if options.api
77
- directory "#{template_engine}/email_mailer", "app/views/email_mailer"
78
- directory "#{template_engine}/password_mailer", "app/views/password_mailer"
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
@@ -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: "The email address doesn't exist in our database" }, status: :not_found
14
+ render json: { error: "Sorry, we didn't recognize that email address" }, status: :not_found
15
15
  end
16
16
  end
17
17
 
@@ -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(email_hint: params[:email]), alert: "The email address doesn't exist in our database"
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, value: params[:email_hint], autofocus: true, required: true %>
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 "The email address doesn't exist in our database", response.parsed_body["error"]
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(email_hint: "invalid_email@hey.com")
34
- assert_equal "The email address doesn't exist in our database", flash[:alert]
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: