adjust for multitenant

This commit is contained in:
Alex Turchyn committed 2023-06-30 22:41:53 +03:00
1 parent c904d51302
commit f5caed502f
24 files changed
+139 -52

No files matched your search

+2 -4
View File
@@ -12,11 +12,9 @@ class EsignSettingsController < ApplicationController
HexaPDF::Document.new(io: StringIO.new(blob.download))
end
cert = EncryptedConfig.find_by(account: current_account, key: EncryptedConfig::ESIGN_CERTS_KEY).value
certs = Accounts.load_signing_certs(current_account)
trusted_certs = [OpenSSL::X509::Certificate.new(cert['cert']),
OpenSSL::X509::Certificate.new(cert['sub_ca']),
OpenSSL::X509::Certificate.new(cert['root_ca'])]
trusted_certs = [certs[:cert], certs[:sub_ca], certs[:root_ca]]
render turbo_stream: turbo_stream.replace('result', partial: 'result', locals: { pdfs:, blobs:, trusted_certs: })
rescue HexaPDF::MalformedPDFError