From f67cf3ab1e8dfa1a36988a1589119358e6c04448 Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Wed, 1 Sep 2021 09:46:00 +0200 Subject: [PATCH] Maintenance: Increase performance of ticket creation via form. --- app/controllers/form_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index b86d42566..a6aa926e6 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -156,7 +156,7 @@ class FormController < ApplicationController end def token_gen(fingerprint) - crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32]) + crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32], serializer: JSON) fingerprint = "#{Base64.strict_encode64(Setting.get('fqdn'))}:#{Time.zone.now.to_i}:#{Base64.strict_encode64(fingerprint)}" Base64.strict_encode64(crypt.encrypt_and_sign(fingerprint)) end @@ -167,7 +167,7 @@ class FormController < ApplicationController raise Exceptions::Forbidden end begin - crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32]) + crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32], serializer: JSON) result = crypt.decrypt_and_verify(Base64.decode64(token)) rescue Rails.logger.info 'Invalid token for form!'