Skip to content

Commit

Permalink
Revert "Add a downcased_logins feature, for normalizing logins to dow…
Browse files Browse the repository at this point in the history
…ncase by default"

This reverts commit eabfa69.

Instead of having a separate feature for this simple configuration
change, we can just point people to the guide added in the previous
commit.
  • Loading branch information
jeremyevans committed Nov 18, 2024
1 parent 9a5fd58 commit 5de5d68
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 67 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
=== master

* Add a downcased_logins feature, for normalizing logins to downcase by default (jeremyevans) (#451)

* Add normalize_login configuration method for normalizing submitted login parameters (jeremyevans) (#451)

* Add login_confirmation_matches? configuration method to allow for case-sensitive login confirmation (jeremyevans) (#451)
Expand Down
2 changes: 0 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ HTML and JSON API for all supported features.
* Reset Password Notify
* Internal Request
* Path Class Methods
* Downcased Logins

== Resources

Expand Down Expand Up @@ -923,7 +922,6 @@ view the appropriate file in the doc directory.
* {Create Account}[rdoc-ref:doc/create_account.rdoc]
* {Disallow Common Passwords}[rdoc-ref:doc/disallow_common_passwords.rdoc]
* {Disallow Password Reuse}[rdoc-ref:doc/disallow_password_reuse.rdoc]
* {Downcased Logins}[rdoc-ref:doc/downcased_logins.rdoc]
* {Email Authentication}[rdoc-ref:doc/email_auth.rdoc]
* {HTTP Basic Auth}[rdoc-ref:doc/http_basic_auth.rdoc]
* {Internal Request}[rdoc-ref:doc/internal_request.rdoc]
Expand Down
10 changes: 0 additions & 10 deletions doc/downcased_logins.rdoc

This file was deleted.

9 changes: 0 additions & 9 deletions lib/rodauth/features/downcased_logins.rb

This file was deleted.

42 changes: 0 additions & 42 deletions spec/create_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,48 +142,6 @@
page.current_path.must_equal '/create-account'
end

it "should not allow creation of account differing in case" do
rodauth do
enable :create_account
enable :downcased_logins if DB.database_type == :sqlite
end
roda do |r|
r.rodauth
next unless rodauth.logged_in?
r.root{view :content=>"Logged In: #{DB[:accounts].where(:id=>rodauth.session_value).get(:email)}"}
end

visit '/create-account'
fill_in 'Login', :with=>'[email protected]'
fill_in 'Confirm Login', :with=>'[email protected]'
fill_in 'Password', :with=>'apple2'
fill_in 'Confirm Password', :with=>'apple2'
click_button 'Create Account'
page.html.must_include("invalid login, already an account with this login")
page.find('#error_flash').text.must_equal "There was an error creating your account"
page.current_path.must_equal '/create-account'
end

it "should work with the downcased_logins feature" do
rodauth do
enable :create_account, :downcased_logins
end
roda do |r|
r.rodauth
next unless rodauth.logged_in?
r.root{view :content=>"Logged In: #{DB[:accounts].where(:id=>rodauth.session_value).get(:email)}"}
end

visit '/create-account'
fill_in 'Login', :with=>'[email protected]'
fill_in 'Confirm Login', :with=>'[email protected]'
fill_in 'Password', :with=>'apple2'
fill_in 'Confirm Password', :with=>'apple2'
click_button 'Create Account'
DB[:accounts].select_map(:email).must_include '[email protected]'
page.html.must_include("Logged In: [email protected]")
end

it "should not display create account link on login page if route is disabled" do
route = 'create-account'
rodauth do
Expand Down
1 change: 0 additions & 1 deletion www/pages/documentation.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<li><a href="rdoc/files/doc/create_account_rdoc.html">Create Account</a>: Allows a user to create an account.</li>
<li><a href="rdoc/files/doc/disallow_common_passwords_rdoc.html">Disallow Common Passwords</a>: Disallows the use of common passwords.</li>
<li><a href="rdoc/files/doc/disallow_password_reuse_rdoc.html">Disallow Password Reuse</a>: Disallows setting password to the same string as previous passwords.</li>
<li><a href="rdoc/files/doc/downcased_logins_rdoc.html">Downcased Logins</a>: Normalized login values to lowercase by default, necessary for case-insensitive logins on SQLite.</li>
<li><a href="rdoc/files/doc/email_auth_rdoc.html">Email Authentication</a>: Allows login via a link sent via email.</li>
<li><a href="rdoc/files/doc/http_basic_auth_rdoc.html">HTTP Basic Auth</a>: Allows HTTP basic authentication.</li>
<li><a href="rdoc/files/doc/internal_request_rdoc.html">Internal Request</a>: Allows interacting with Rodauth by calling methods.</li>
Expand Down
1 change: 0 additions & 1 deletion www/pages/why.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<li>JWT Refresh (Access &amp; refresh tokens)</li>
<li>Internal Request (Interact with Rodauth via methods)</li>
<li>Path Class Methods (Get paths/URLs for features via class methods)</li>
<li>Downcased Logins (Normalize logins to lowercase by default)</li>
</ul>

<p style="margin-top: 20px;">You can learn more about these features by reviewing <a href="documentation.html">Rodauth's documentation</a>.</p>

0 comments on commit 5de5d68

Please sign in to comment.