authentication_with_registration_generator 0.3.1 → 0.3.3

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: 4f07ce09316587d1fdca12a470fb391994751beda2a253a2c7f4c1364a89e311
4
- data.tar.gz: b93764b9bfa9f606559b3e45f641aed8f83e25767b89b2697f08acf695d38440
3
+ metadata.gz: e2af1fb45e405f12df5e826d7ca8db516184ddbddff53aef0c8aef8ad8e332be
4
+ data.tar.gz: cb3dd9a2111996624d715a437223d98dce161a078a04bbe2c7ef9f2d63fb5dd9
5
5
  SHA512:
6
- metadata.gz: dc2d1419aae5ce7cdee1b8d26908c76d104c71ba1ede362c1714db1aee1301d6a151f13f9e05ba460189765e7d6ecabe47130c793811c15cc33577834ea124a8
7
- data.tar.gz: ccdb829c2453e877baa7602ae91b28ac5a99f62ede1e2342f1c04c78119f805e2d3d0da23b3c151da43116eef338f6a7bf27a7c77940125a7ec29f1a5db4f601
6
+ metadata.gz: b5599634fe5d9503c956069e8d0a79c38e46a9cde0ecf7456e6cca241ab0fabb55a5cdc6e5a13ec8d18bb71887fe306d42031d71bf69ae66436fe1b17a493519
7
+ data.tar.gz: 149f1e0d9d8d04ffae7422eadc8585e49989dff354262e09ab710d8e2462d0f2096ca171354c9d5413d9446e598ab39a1f2332a5836d2028c926ad2b36f97f45
@@ -10,7 +10,6 @@ module Authentication
10
10
  invoke "rails:authentication"
11
11
  end
12
12
  end
13
-
14
13
 
15
14
  def create_view
16
15
  template "registration_form.html.erb", "app/views/registrations/new.html.erb"
@@ -31,10 +30,10 @@ module Authentication
31
30
  session_view_path = "app/views/sessions/new.html.erb"
32
31
 
33
32
  # Check if the file exists before modifying it
34
- if File.exists?(session_view_path)
33
+ if File.exist?(session_view_path)
35
34
  # Replace the "Forgot password?" link with the new links
36
35
  gsub_file session_view_path, /<br>\s*<%= link_to "Forgot password\?", new_password_path %>/ do |match|
37
- "<p>\n <%= link_to 'Forgot password?', new_password_path %> | \n <%= link_to 'No Account? Register here', new_registration_path %>\n</p>"
36
+ "<p>\n <%%= link_to 'Forgot password?', new_password_path %> | \n <%= link_to 'No Account? Register here', new_registration_path %>\n</p>"
38
37
  end
39
38
  else
40
39
  # If the file doesn't exist, handle it accordingly (e.g., raise an error or create the file)
@@ -48,16 +47,14 @@ module Authentication
48
47
 
49
48
  def link_to_sign_in_or_out
50
49
  if authenticated?
51
- authenticity_token = form_authenticity_token
52
- action_url = sign_out_path
53
50
  # Return the form as a string
54
- "<form class=\"button_to\" action=\"#{action_url}\" accept-charset=\"UTF-8\" method=\"post\">
51
+ "<form class=\"button_to\" action=\"\#{sign_out_path}\" accept-charset=\"UTF-8\" method=\"post\">
55
52
  <input type=\"hidden\" name=\"_method\" value=\"delete\" autocomplete=\"off\" />
56
53
  <button type=\"submit\">Sign Out</button>
57
- <input type=\"hidden\" name=\"authenticity_token\" value=\"#{authenticity_token}\" autocomplete=\"off\" />
54
+ <input type=\"hidden\" name=\"authenticity_token\" value=\"\#{form_authenticity_token}\" autocomplete=\"off\" />
58
55
  </form>".html_safe
59
56
  else
60
- "<a href=\"#{sign_in_path}\">Sign In</a>".html_safe
57
+ "<a href=\"\#{sign_in_path}\">Sign In</a>".html_safe
61
58
  end
62
59
  end
63
60
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AuthenticationGenerator
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication_with_registration_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - DAZ