mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							20 lines
						
					
					
						
							650 B
						
					
					
				
			
		
		
	
	
							20 lines
						
					
					
						
							650 B
						
					
					
				# frozen_string_literal: true
 | 
						|
 | 
						|
class VerifyPdfSignatureController < ApplicationController
 | 
						|
  skip_authorization_check
 | 
						|
 | 
						|
  def create
 | 
						|
    pdfs =
 | 
						|
      params[:files].map do |file|
 | 
						|
        HexaPDF::Document.new(io: file.open)
 | 
						|
      end
 | 
						|
 | 
						|
    trusted_certs = Accounts.load_trusted_certs(current_account)
 | 
						|
 | 
						|
    render turbo_stream: turbo_stream.replace('result', partial: 'result',
 | 
						|
                                                        locals: { pdfs:, files: params[:files], trusted_certs: })
 | 
						|
  rescue HexaPDF::MalformedPDFError
 | 
						|
    render turbo_stream: turbo_stream.replace('result', html: helpers.tag.div(I18n.t('invalid_pdf'), id: 'result'))
 | 
						|
  end
 | 
						|
end
 |