authentication-zero 0.0.10 → 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: ff917e8d503041f0656c5897b5ccf89d2304b73633dc41198089052b3eeab2b5
4
- data.tar.gz: c6c2d8e0be204bc3eb59bdf62aebe98a8b1de24e8610d2653bf8b274db3c3813
3
+ metadata.gz: 0ea1c631f09f3da8a3b5e183d431e5596875bd04044b0a6e74a44943d7eabb8d
4
+ data.tar.gz: 8242c5411752b806bca65bf8b3ac0d457231b830381b5d0369e6ea2daa2374f0
5
5
  SHA512:
6
- metadata.gz: 54a53d0d0124155b3187ee51d568310834bb63fbab8c99520ecd816bdad57ad3bdc450105509b721fce934d13952f43db08d35178c8365e63526baa940f1e32e
7
- data.tar.gz: 629dccfe0f036adea1bdb3655d574bbbe713259ac55a56769f475405cfcb27c6006199a0b33225ca0dc6826db87e3c21ac84a9e4a1813210d304997f59acbe0d
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.10)
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.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -25,7 +25,7 @@ class PasswordResetsController < ApplicationController
25
25
 
26
26
  private
27
27
  def set_<%= singular_table_name %>
28
- @<%= 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")
29
29
  rescue ActiveSupport::MessageVerifier::InvalidSignature
30
30
  render json: { error: "Your token has expired, please request a new one" }, status: :bad_request
31
31
  end
@@ -1,7 +1,7 @@
1
1
  class PasswordResetsController < ApplicationController
2
2
  skip_before_action :authenticate
3
3
 
4
- before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
4
+ before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
5
5
 
6
6
  def new
7
7
  end
@@ -28,9 +28,9 @@ class PasswordResetsController < ApplicationController
28
28
 
29
29
  private
30
30
  def set_<%= singular_table_name %>
31
- @<%= 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")
32
32
  rescue ActiveSupport::MessageVerifier::InvalidSignature
33
- 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"
34
34
  end
35
35
 
36
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: 20.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,6 +1,6 @@
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
 
@@ -1,8 +1,8 @@
1
1
  <p>Hey there,</p>
2
2
 
3
- <p>Cant remember your password for <strong><%%= params[:<%= singular_table_name %>].email %></strong>? Thats OK, it happens. Just hit the link below to set a new one.</p>
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
- <p><%%= link_to "Reset my password", password_reset_edit_url(token: @token) %></p>
5
+ <p><%%= link_to "Reset my password", password_reset_edit_url(sid: @signed_id) %></p>
6
6
 
7
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
8
 
@@ -1,8 +1,8 @@
1
1
  Hey there,
2
2
 
3
- Cant remember your password for <%%= params[:<%= singular_table_name %>].email %>? Thats OK, it happens. Just hit the link below to set a new one.
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
- [Reset my password]<%%= password_reset_edit_url(token: @token) %>
5
+ [Reset my password]<%%= password_reset_edit_url(sid: @signed_id) %>
6
6
 
7
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
8
 
@@ -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,6 +13,8 @@
13
13
  </div>
14
14
  <%% end %>
15
15
 
16
+ <%%= hidden_field_tag :sid, params[:sid] %>
17
+
16
18
  <div>
17
19
  <%%= form.label :password, "New password", style: "display: block" %>
18
20
  <%%= form.password_field :password, autofocus: true, autocomplete: "new-password" %>
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: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon