From 5ab8b141eb7e49457d707a024afa6b769f484478 Mon Sep 17 00:00:00 2001 From: Renata Marques Date: Fri, 1 May 2020 00:06:04 -0300 Subject: [PATCH] adding error when key is missing --- lib/knock.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/knock.rb b/lib/knock.rb index 0337700..c64797a 100644 --- a/lib/knock.rb +++ b/lib/knock.rb @@ -17,7 +17,11 @@ module Knock # Configure the key used to sign tokens. mattr_accessor :token_secret_signature_key - self.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base } + begin + self.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base } + rescue + raise "Knock secret signature key can't be empty" + end # Configure the public key used to decode tokens, when required. mattr_accessor :token_public_key