authentication-zero 0.0.7 → 0.0.11

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: 00f2558085051718c5d29c5aeb4f4f5ebb5daf9d6a165c0f8dd588771b73789a
4
- data.tar.gz: c4c548e20a25306b3dc44cc46fd4c5dae7d798a8bce4dc352bf0bce314b33b53
3
+ metadata.gz: 0ea1c631f09f3da8a3b5e183d431e5596875bd04044b0a6e74a44943d7eabb8d
4
+ data.tar.gz: 8242c5411752b806bca65bf8b3ac0d457231b830381b5d0369e6ea2daa2374f0
5
5
  SHA512:
6
- metadata.gz: d3ea2a5b31a39bd3aa1f029c96f5c24791d6df8da63b41384e806ad79887122497e1845c4b509c4caf8414ff48eb1a6830d438c0f6d9b31870fed145999f3d84
7
- data.tar.gz: 57b4ff721d9c4af1d30aa50f2495869d31a3a8a0d5017ee3d78d12df257625716e5dad2ba58e05a73c0c8e7a70e42bc519fe6ed77301da6fd58da0a6dddc1395
6
+ metadata.gz: 4f73c08b89896448ceb9ce7b19df4d97a6c7ec20bfbd977c2b07b10ef20535a45a94015ccee0e13c23351388e69d0b10598a9c2ed4678858147753fdf78631d8
7
+ data.tar.gz: 02d3dfd0571bb4d8f20a91eeae99f5d430f747c8651751ad4eecb566b214488535d029e746c63ea6c5a76566fc4e115c88d2c1f8a4b3801d02d0d0edc896f1ea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (0.0.7)
4
+ authentication-zero (0.0.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -23,7 +23,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
23
23
  if options.api
24
24
  directory "views/password_mailer", "app/views/password_mailer"
25
25
  else
26
- directory "views/html", "app/views"
26
+ directory "views", "app/views"
27
27
  end
28
28
  end
29
29
 
@@ -1,9 +1,10 @@
1
1
  class PasswordResetsController < ApplicationController
2
- before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
3
2
  skip_before_action :authenticate
4
3
 
4
+ before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
5
+
5
6
  def edit
6
- render json: { message: "Open this link in your device" }, status: :not_found
7
+ render json: { error: "Open this link in your device" }, status: :not_found
7
8
  end
8
9
 
9
10
  def create
@@ -24,7 +25,7 @@ class PasswordResetsController < ApplicationController
24
25
 
25
26
  private
26
27
  def set_<%= singular_table_name %>
27
- @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: "password_reset")
28
+ @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:sid], purpose: "password_reset")
28
29
  rescue ActiveSupport::MessageVerifier::InvalidSignature
29
30
  render json: { error: "Your token has expired, please request a new one" }, status: :bad_request
30
31
  end
@@ -1,7 +1,8 @@
1
1
  class PasswordResetsController < ApplicationController
2
- before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
3
2
  skip_before_action :authenticate
4
3
 
4
+ before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
5
+
5
6
  def new
6
7
  end
7
8
 
@@ -27,9 +28,9 @@ class PasswordResetsController < ApplicationController
27
28
 
28
29
  private
29
30
  def set_<%= singular_table_name %>
30
- @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: "password_reset")
31
+ @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:sid], purpose: "password_reset")
31
32
  rescue ActiveSupport::MessageVerifier::InvalidSignature
32
- redirect_to sign_in_path, alert: "Your token has expired, please request a new one"
33
+ redirect_to password_reset_new_path, alert: "Your token has expired, please request a new one"
33
34
  end
34
35
 
35
36
  def password_params
@@ -1,6 +1,6 @@
1
1
  class PasswordMailer < ApplicationMailer
2
2
  def reset
3
- @token = params[:<%= singular_table_name %>].signed_id(purpose: "password_reset", expires_in: 15.minutes)
3
+ @signed_id = params[:<%= singular_table_name %>].signed_id(purpose: "password_reset", expires_in: 20.minutes)
4
4
  mail to: params[:<%= singular_table_name %>].email
5
5
  end
6
6
  end
@@ -1,11 +1,11 @@
1
1
  <h1>Want to close your account?</h1>
2
2
 
3
- <p>Your account will be immediately closed. You wont be able to sign in anymore.</p>
3
+ <p>Your account will be immediately closed. You won't be able to sign in anymore.</p>
4
4
  <p>Your data will be permanently deleted from our servers.</p>
5
5
  <p><%%= link_to "Back", root_path %></p>
6
6
 
7
7
  <br>
8
8
 
9
9
  <div>
10
- <%%= button_to "OK, close my account", cancellation_path, method: :post %>
10
+ <%%= button_to "OK, close my account", cancellation_path %>
11
11
  </div>
@@ -1,7 +1,11 @@
1
- Hi <%%= params[:<%= singular_table_name %>].email %>,
1
+ <p>Hey there,</p>
2
2
 
3
- Someone requested a reset of your password.
3
+ <p>Can't remember your password for <strong><%%= params[:<%= singular_table_name %>].email %></strong>? That's OK, it happens. Just hit the link below to set a new one.</p>
4
4
 
5
- If this was you, click the link to reset your password. The link will expire automatically in 15 minutes.
5
+ <p><%%= link_to "Reset my password", password_reset_edit_url(sid: @signed_id) %></p>
6
6
 
7
- <%%= link_to "Reset password", password_reset_edit_url(token: @token) %>
7
+ <p>If you did not request a password reset you can safely ignore this email, it expires in 20 minutes. Only someone with access to this email account can reset your password.</p>
8
+
9
+ <hr>
10
+
11
+ <p>Have questions or need help? Just reply to this email and our support team will help you sort it out.</p>
@@ -1,7 +1,9 @@
1
- Hi <%%= params[:<%= singular_table_name %>].email %>,
1
+ Hey there,
2
2
 
3
- Someone requested a reset of your password.
3
+ Can't remember your password for <%%= params[:<%= singular_table_name %>].email %>? That's OK, it happens. Just hit the link below to set a new one.
4
4
 
5
- If this was you, click the link to reset your password. The link will expire automatically in 15 minutes.
5
+ [Reset my password]<%%= password_reset_edit_url(sid: @signed_id) %>
6
6
 
7
- <%%= password_reset_edit_url(token: @token) %>
7
+ If you did not request a password reset you can safely ignore this email, it expires in 20 minutes. Only someone with access to this email account can reset your password.
8
+
9
+ Have questions or need help? Just reply to this email and our support team will help you sort it out.
@@ -1,6 +1,6 @@
1
1
  <h1>Reset your password</h1>
2
2
 
3
- <%%= form_with(model: @<%= model_resource_name %>, url: password_reset_path(token: params[:token])) do |form| %>
3
+ <%%= form_with(model: @<%= model_resource_name %>, url: password_reset_path) do |form| %>
4
4
  <%% if @<%= singular_table_name %>.errors.any? %>
5
5
  <div style="color: red">
6
6
  <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
@@ -13,24 +13,20 @@
13
13
  </div>
14
14
  <%% end %>
15
15
 
16
+ <%%= hidden_field_tag :sid, params[:sid] %>
17
+
16
18
  <div>
17
- <%%= form.label :password, "New password (8 characters minimum)", style: "display: block" %>
19
+ <%%= form.label :password, "New password", style: "display: block" %>
18
20
  <%%= form.password_field :password, autofocus: true, autocomplete: "new-password" %>
21
+ <div>8 characters minimum.</div>
19
22
  </div>
20
23
 
21
24
  <div>
22
- <%%= form.label :password_confirmation, style: "display: block" %>
25
+ <%%= form.label :password_confirmation, "Confirm new password", style: "display: block" %>
23
26
  <%%= form.password_field :password_confirmation, autocomplete: "new-password" %>
24
27
  </div>
25
28
 
26
29
  <div>
27
- <%%= form.submit "Reset password" %>
30
+ <%%= form.submit "Save changes" %>
28
31
  </div>
29
32
  <%% end %>
30
-
31
- <br>
32
-
33
- <div>
34
- <%%= link_to "Sign in", sign_in_path %> |
35
- <%%= link_to "Sign up", sign_up_path %>
36
- </div>
@@ -5,17 +5,10 @@
5
5
  <%%= form_with(url: password_reset_path) do |form| %>
6
6
  <div>
7
7
  <%%= form.label :email, style: "display: block" %>
8
- <%%= form.email_field :email, autofocus: true, required: true, autocomplete: "email" %>
8
+ <%%= form.email_field :email, autofocus: true, required: true %>
9
9
  </div>
10
10
 
11
11
  <div>
12
12
  <%%= form.submit "Send password reset email" %>
13
13
  </div>
14
14
  <%% end %>
15
-
16
- <br>
17
-
18
- <div>
19
- <%%= link_to "Sign in", sign_in_path %> |
20
- <%%= link_to "Sign up", sign_up_path %>
21
- </div>
@@ -21,12 +21,13 @@
21
21
  </div>
22
22
 
23
23
  <div>
24
- <%%= form.label :password, "New password (8 characters minimum)", style: "display: block" %>
24
+ <%%= form.label :password, "New password", style: "display: block" %>
25
25
  <%%= form.password_field :password, autocomplete: "new-password" %>
26
+ <div>8 characters minimum.</div>
26
27
  </div>
27
28
 
28
29
  <div>
29
- <%%= form.label :password_confirmation, style: "display: block" %>
30
+ <%%= form.label :password_confirmation, "Confirm new password", style: "display: block" %>
30
31
  <%%= form.password_field :password_confirmation, autocomplete: "new-password" %>
31
32
  </div>
32
33
 
@@ -19,8 +19,9 @@
19
19
  </div>
20
20
 
21
21
  <div>
22
- <%%= form.label :password, "Password (8 characters minimum)", style: "display: block" %>
22
+ <%%= form.label :password, style: "display: block" %>
23
23
  <%%= form.password_field :password, autocomplete: "new-password" %>
24
+ <div>8 characters minimum.</div>
24
25
  </div>
25
26
 
26
27
  <div>
@@ -32,9 +33,3 @@
32
33
  <%%= form.submit "Sign up" %>
33
34
  </div>
34
35
  <%% end %>
35
-
36
- <br>
37
-
38
- <div>
39
- <%%= link_to "Sign in", sign_in_path %>
40
- </div>
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: 0.0.7
4
+ version: 0.0.11
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-15 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: