Allow disable devise lockable through secrets

This commit is contained in:
taitus
2023-04-05 11:38:17 +02:00
parent a1955531e1
commit 873ec84b52
4 changed files with 11 additions and 1 deletions

View File

@@ -3,8 +3,9 @@ class User < ApplicationRecord
attribute :registering_from_web, default: false
devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
:trackable, :validatable, :omniauthable, :password_expirable, :secure_validatable, :lockable,
:trackable, :validatable, :omniauthable, :password_expirable, :secure_validatable,
authentication_keys: [:login]
devise :lockable if Rails.application.config.devise_lockable
acts_as_voter
acts_as_paranoid column: :hidden_at

View File

@@ -138,6 +138,9 @@ module Consul
config.paths["app/views"].unshift(Rails.root.join("app", "views", "custom"))
# Set to true to enable devise user lockable feature
config.devise_lockable = Rails.application.secrets.devise_lockable
# Set to true to enable managing different tenants using the same application
config.multitenancy = Rails.application.secrets.multitenancy
end

View File

@@ -81,6 +81,8 @@ Rails.application.configure do
# Allow managing different tenants using the same application
config.multitenancy = true
config.devise_lockable = true
end
require Rails.root.join("config", "environments", "custom", "test")

View File

@@ -18,6 +18,7 @@ http_basic_auth: &http_basic_auth
development:
http_basic_username: "dev"
http_basic_password: "pass"
devise_lockable: false
multitenancy: false
security:
last_sign_in: false
@@ -50,6 +51,7 @@ staging:
errbit_self_hosted_ssl: false
http_basic_username: ""
http_basic_password: ""
devise_lockable: false
managers_url: ""
managers_application_key: ""
multitenancy: false
@@ -89,6 +91,7 @@ preproduction:
errbit_self_hosted_ssl: false
http_basic_username: ""
http_basic_password: ""
devise_lockable: false
managers_url: ""
managers_application_key: ""
multitenancy: false
@@ -133,6 +136,7 @@ production:
errbit_self_hosted_ssl: false
http_basic_username: ""
http_basic_password: ""
devise_lockable: false
managers_url: ""
managers_application_key: ""
multitenancy: false