From e991b9761cda749ba577cfafb21ad6838109bfdd Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 13 Sep 2019 22:16:04 +0500 Subject: [PATCH] Improve code --- app/controllers/staffs/x509_certificates_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/staffs/x509_certificates_controller.rb b/app/controllers/staffs/x509_certificates_controller.rb index 45c2c01..818e187 100644 --- a/app/controllers/staffs/x509_certificates_controller.rb +++ b/app/controllers/staffs/x509_certificates_controller.rb @@ -35,7 +35,7 @@ class Staffs::X509CertificatesController < ApplicationController result = CreateRSAKeysAndX509SelfSignedCertificate.call \ @x509_certificate_form.attributes - redirect_to after_create_url result.certificate, result.key + redirect_to after_create_url result.certificate end private @@ -52,11 +52,11 @@ private ) end - def after_create_url(certificate, key) + def after_create_url(certificate) staff_x509_certificate_url( certificate, private_key_pem_secret: Base64.urlsafe_encode64( - key.private_key_pem_secret, + certificate.rsa_key.private_key_pem_secret, ), ) end