Skip to content

Commit

Permalink
Add lockable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaronixon committed Oct 8, 2024
1 parent e80519e commit 4c1116e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
bundler-cache: true

- name: Install the latest Rails gem
run: gem install rails -v "7.1.0"
run: gem install rails -v "7.2.1"

- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
bundler-cache: true

- name: Install the latest Rails gem
run: gem install rails -v "7.1.0"
run: gem install rails -v "7.2.1"

- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Since Authentication Zero generates this code into your application instead of b
- Ask password before sensitive data changes, aka: sudo (--sudoable)
- Reset the user password and send reset instructions
- Reset the user password only from verified emails
- Lock mechanism to prevent email bombing (--lockable)
- Rate limiting for your app, 1000 reqs/minute (--ratelimit)
- Send e-mail confirmation when your email has been changed
- Manage multiple sessions & devices
Expand Down
2 changes: 1 addition & 1 deletion lib/authentication_zero/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AuthenticationZero
VERSION = "4.0.0"
VERSION = "4.0.1"
end
3 changes: 1 addition & 2 deletions lib/generators/authentication/authentication_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ class AuthenticationGenerator < Rails::Generators::Base
class_option :api, type: :boolean, desc: "Generates API authentication"
class_option :pwned, type: :boolean, desc: "Add pwned password validation"
class_option :sudoable, type: :boolean, desc: "Add password request before sensitive data changes"
class_option :lockable, type: :boolean, desc: "Add password reset locking"
class_option :ratelimit, type: :boolean, desc: "Add request rate limiting"
class_option :passwordless, type: :boolean, desc: "Add passwordless sign"
class_option :passwordless, type: :boolean, desc: "Add passwordless sign in"
class_option :omniauthable, type: :boolean, desc: "Add social login support"
class_option :trackable, type: :boolean, desc: "Add activity log support"
class_option :two_factor, type: :boolean, desc: "Add two factor authentication"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class Identity::PasswordResetsController < ApplicationController
skip_before_action :authenticate

<%- if options.lockable? -%>
rate_limit to: 10, within: 1.hour, only: :create
<%- end -%>

before_action :set_user, only: :update

def edit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class Identity::PasswordResetsController < ApplicationController
skip_before_action :authenticate

<%- if options.lockable? -%>
rate_limit to: 10, within: 1.hour, only: :create, with: -> { redirect_to root_path, alert: "Try again later" }
<%- end -%>

before_action :set_user, only: %i[ edit update ]

def new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class Sessions::PasswordlessesController < ApplicationController
skip_before_action :authenticate

<%- if options.lockable? -%>
rate_limit to: 10, within: 1.hour, only: :create, with: -> { redirect_to root_path, alert: "Try again later" }
<%- end -%>

before_action :set_user, only: :edit

def new
Expand Down

0 comments on commit 4c1116e

Please sign in to comment.