adjust for multitenant
This commit is contained in:
+10
-1
@@ -5,13 +5,22 @@ module Docuseal
|
||||
PRODUCT_NAME = 'DocuSeal'
|
||||
DEFAULT_APP_URL = 'http://localhost:3000'
|
||||
|
||||
CERTS = JSON.parse(ENV.fetch('CERTS', '{}'))
|
||||
|
||||
DEFAULT_URL_OPTIONS = {
|
||||
host: ENV.fetch('HOST', 'localhost'),
|
||||
protocol: ENV['FORCE_SSL'] == 'true' ? 'https' : 'http'
|
||||
}.freeze
|
||||
|
||||
module_function
|
||||
|
||||
def multitenant?
|
||||
ENV['MULTITENANT'] == true
|
||||
ENV['MULTITENANT'] == 'true'
|
||||
end
|
||||
|
||||
def default_url_options
|
||||
return DEFAULT_URL_OPTIONS if multitenant?
|
||||
|
||||
@default_url_options ||= begin
|
||||
value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value
|
||||
value ||= DEFAULT_APP_URL
|
||||
|
||||
Reference in New Issue
Block a user