Improve code
This commit is contained in:
parent
ac18d6f7bc
commit
e991b9761c
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ class Staffs::X509CertificatesController < ApplicationController
|
||||||
result = CreateRSAKeysAndX509SelfSignedCertificate.call \
|
result = CreateRSAKeysAndX509SelfSignedCertificate.call \
|
||||||
@x509_certificate_form.attributes
|
@x509_certificate_form.attributes
|
||||||
|
|
||||||
redirect_to after_create_url result.certificate, result.key
|
redirect_to after_create_url result.certificate
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -52,11 +52,11 @@ private
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_create_url(certificate, key)
|
def after_create_url(certificate)
|
||||||
staff_x509_certificate_url(
|
staff_x509_certificate_url(
|
||||||
certificate,
|
certificate,
|
||||||
private_key_pem_secret: Base64.urlsafe_encode64(
|
private_key_pem_secret: Base64.urlsafe_encode64(
|
||||||
key.private_key_pem_secret,
|
certificate.rsa_key.private_key_pem_secret,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue