mirror of https://github.com/docusealco/docuseal
parent
4977ee429c
commit
0ac30a5fc0
@ -0,0 +1,7 @@
|
||||
export default class extends HTMLElement {
|
||||
connectedCallback () {
|
||||
if (this.dataset.inputId) {
|
||||
document.getElementById(this.dataset.inputId).value = document.location.origin
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
Loading…
Reference in new issue