lib/volt/server/message_bus/message_encoder.rb in volt-0.9.4 vs lib/volt/server/message_bus/message_encoder.rb in volt-0.9.5.pre1
- old
+ new
@@ -30,9 +30,13 @@
rescue LoadError => e
Volt.logger.error('Volt requires the rbnacl gem to enable encryption on the message bus. Add it to the gemfile (and rbnacl-sodium if you don\'t have libsodium installed locally')
raise e
end
+ if Volt.config.app_secret.blank?
+ raise "No app_secret has been specified in Volt.config"
+ end
+
# use the first 32 chars of the app secret for the encryption key.
key = Base64.decode64(Volt.config.app_secret)[0..31]
@encrypt_box = RbNaCl::SimpleBox.from_secret_key(key)
end
\ No newline at end of file