add the app url input on the first setup page

This commit is contained in:
Alex Turchyn committed 2023-06-23 00:54:40 +03:00
1 parent 4977ee429c
commit 0ac30a5fc0
14 files changed
+93 -11

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
# frozen_string_literal: true
module Docuseal
DEFAULT_APP_URL = 'http://localhost:3000'
module_function
def default_url_options
@default_url_options ||= begin
value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value
value ||= DEFAULT_APP_URL
url = Addressable::URI.parse(value)
{ host: url.host, port: url.port, protocol: url.scheme }
end
end
def refresh_default_url_options!
@default_url_options = nil
end
end