Allow disable devise lockable through secrets
This commit is contained in:
@@ -3,8 +3,9 @@ class User < ApplicationRecord
|
|||||||
attribute :registering_from_web, default: false
|
attribute :registering_from_web, default: false
|
||||||
|
|
||||||
devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
|
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]
|
authentication_keys: [:login]
|
||||||
|
devise :lockable if Rails.application.config.devise_lockable
|
||||||
|
|
||||||
acts_as_voter
|
acts_as_voter
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
|
|||||||
@@ -138,6 +138,9 @@ module Consul
|
|||||||
|
|
||||||
config.paths["app/views"].unshift(Rails.root.join("app", "views", "custom"))
|
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
|
# Set to true to enable managing different tenants using the same application
|
||||||
config.multitenancy = Rails.application.secrets.multitenancy
|
config.multitenancy = Rails.application.secrets.multitenancy
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Allow managing different tenants using the same application
|
# Allow managing different tenants using the same application
|
||||||
config.multitenancy = true
|
config.multitenancy = true
|
||||||
|
|
||||||
|
config.devise_lockable = true
|
||||||
end
|
end
|
||||||
|
|
||||||
require Rails.root.join("config", "environments", "custom", "test")
|
require Rails.root.join("config", "environments", "custom", "test")
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ http_basic_auth: &http_basic_auth
|
|||||||
development:
|
development:
|
||||||
http_basic_username: "dev"
|
http_basic_username: "dev"
|
||||||
http_basic_password: "pass"
|
http_basic_password: "pass"
|
||||||
|
devise_lockable: false
|
||||||
multitenancy: false
|
multitenancy: false
|
||||||
security:
|
security:
|
||||||
last_sign_in: false
|
last_sign_in: false
|
||||||
@@ -50,6 +51,7 @@ staging:
|
|||||||
errbit_self_hosted_ssl: false
|
errbit_self_hosted_ssl: false
|
||||||
http_basic_username: ""
|
http_basic_username: ""
|
||||||
http_basic_password: ""
|
http_basic_password: ""
|
||||||
|
devise_lockable: false
|
||||||
managers_url: ""
|
managers_url: ""
|
||||||
managers_application_key: ""
|
managers_application_key: ""
|
||||||
multitenancy: false
|
multitenancy: false
|
||||||
@@ -89,6 +91,7 @@ preproduction:
|
|||||||
errbit_self_hosted_ssl: false
|
errbit_self_hosted_ssl: false
|
||||||
http_basic_username: ""
|
http_basic_username: ""
|
||||||
http_basic_password: ""
|
http_basic_password: ""
|
||||||
|
devise_lockable: false
|
||||||
managers_url: ""
|
managers_url: ""
|
||||||
managers_application_key: ""
|
managers_application_key: ""
|
||||||
multitenancy: false
|
multitenancy: false
|
||||||
@@ -133,6 +136,7 @@ production:
|
|||||||
errbit_self_hosted_ssl: false
|
errbit_self_hosted_ssl: false
|
||||||
http_basic_username: ""
|
http_basic_username: ""
|
||||||
http_basic_password: ""
|
http_basic_password: ""
|
||||||
|
devise_lockable: false
|
||||||
managers_url: ""
|
managers_url: ""
|
||||||
managers_application_key: ""
|
managers_application_key: ""
|
||||||
multitenancy: false
|
multitenancy: false
|
||||||
|
|||||||
Reference in New Issue
Block a user