From 102e919318ec528b9f5908e10d6427847d7a197b Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Sun, 22 May 2022 11:53:06 -0400 Subject: [PATCH] Rails default key generator hash digest class is respected (#335) --- lib/turbo/engine.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/turbo/engine.rb b/lib/turbo/engine.rb index 382623bd..9234f563 100644 --- a/lib/turbo/engine.rb +++ b/lib/turbo/engine.rb @@ -61,8 +61,10 @@ class Engine < Rails::Engine end initializer "turbo.signed_stream_verifier_key" do - Turbo.signed_stream_verifier_key = config.turbo.signed_stream_verifier_key || - Rails.application.key_generator.generate_key("turbo/signed_stream_verifier_key") + config.after_initialize do + Turbo.signed_stream_verifier_key = config.turbo.signed_stream_verifier_key || + Rails.application.key_generator.generate_key("turbo/signed_stream_verifier_key") + end end initializer "turbo.test_assertions" do