From 2b29bb8978f33d163682863638a3f4ffb87e6e5b Mon Sep 17 00:00:00 2001 From: zernie Date: Wed, 2 Jun 2021 20:23:53 +0300 Subject: [PATCH] feat: add lockable setting --- app/models/spree/user.rb | 1 + lib/spree/auth_configuration.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/spree/user.rb b/app/models/spree/user.rb index b8157612..20d3ea06 100644 --- a/app/models/spree/user.rb +++ b/app/models/spree/user.rb @@ -8,6 +8,7 @@ class User < Spree::Base :rememberable, :trackable, :validatable, :encryptable devise :confirmable if Spree::Auth::Config[:confirmable] devise :omniauthable, omniauth_providers: Spree::Auth::Config[:omniauthable] if Spree::Auth::Config[:omniauthable].present? + devise :lockable if Spree::Auth::Config[:lockable].present? if defined?(Spree::SoftDeletable) include Spree::SoftDeletable diff --git a/lib/spree/auth_configuration.rb b/lib/spree/auth_configuration.rb index 5efd9232..3a344050 100644 --- a/lib/spree/auth_configuration.rb +++ b/lib/spree/auth_configuration.rb @@ -5,6 +5,7 @@ class AuthConfiguration < Preferences::Configuration preference :registration_step, :boolean, default: true preference :signout_after_password_change, :boolean, default: true preference :confirmable, :boolean, default: false + preference :lockable, :boolean, default: false preference :omniauthable_providers, :array, default: [] preference :draw_frontend_routes, :boolean, default: true preference :draw_backend_routes, :boolean, default: true