add the app url input on the first setup page

This commit is contained in:
Alex Turchyn
2023-06-20 23:42:56 +03:00
parent 4977ee429c
commit 0ac30a5fc0
14 changed files with 93 additions and 11 deletions
+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