Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lockable #119

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Authentication Zero 4.0.1 ##

* Add --lockable to the default generator.

## Authentication Zero 4.0.0 ##

* Remove system tests
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
authentication-zero (4.0.0)
authentication-zero (4.0.1)

GEM
remote: https://rubygems.org/
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
Loading