From c4bc48967734b4426b4ae81c88b7964bbb7b928b Mon Sep 17 00:00:00 2001 From: Josep Egea Date: Wed, 30 Oct 2024 18:01:18 +0100 Subject: [PATCH] Disable exception catching for bad tokens --- lib/omni_auth/strategies/email.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/omni_auth/strategies/email.rb b/lib/omni_auth/strategies/email.rb index 7954acc1..9e55e930 100644 --- a/lib/omni_auth/strategies/email.rb +++ b/lib/omni_auth/strategies/email.rb @@ -18,11 +18,9 @@ def callback_phase token = request.params['token'] fail!(:authenticity_error) if token.blank? - begin - decoded_token = EmailAuthToken.decode(token) - rescue StandardError => e - fail!(:authenticity_error, e) - end + # Not catching the exception until this is more tested + # This way we'll get it reported in AppSignal for diagnosing + decoded_token = EmailAuthToken.decode(token) @email = decoded_token['iss'].to_s.downcase fail!(:authenticity_error) if @email.blank?