From 0ff301cd5792dc6982670af0648133bdbdf5bcb0 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Tue, 26 Jan 2021 15:33:51 -0700 Subject: [PATCH] Don't send failures to SessionController in development environment (#2121) Since bumping omniauth from 1.9.1 to 2.0.1 in our application all development errors have become failures. For example I purposefully introduce an error to a view. It is caught by omniauth and calls fail which means that we can no longer use better_errors to debug. Opened a ticket with omniauth to see if they have any suggestions. --- CHANGELOG.md | 1 + config/initializers/omniauth.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafc77b3..aced52a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and releases in Jupiter project adheres to [Semantic Versioning](http://semver.o – Turn off reporting things like "this excel spreadsheet isn't thumbnailable" as warnings to Rollbar [PR#2046](https://github.com/ualbertalib/jupiter/pull/2046) - migration to fix concatenated subjects (part 2) [#1449](https://github.com/ualbertalib/jupiter/issues/1449) - Catch and log embargo expiry job save errors [#1989](https://github.com/ualbertalib/jupiter/issues/1989) +- Don't send failures to SessionController in development environment [PR#2121](https://github.com/ualbertalib/jupiter/pull/2121) ### Fixed - bump rubocop and fix cop violations [PR#2072](https://github.com/ualbertalib/jupiter/pull/2072) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 926bd1add..ebfeacb19 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -19,7 +19,7 @@ # By default in development mode, omniauth raises an exception when authentication fails # comment this line if you want to see the stacktrace from the actual provider when in `development` # Uncomment the line below to turn this behavior off - on_failure { |env| SessionsController.action(:failure).call(env) } + on_failure { |env| SessionsController.action(:failure).call(env) } unless Rails.env.development? OmniAuth.config.allowed_request_methods = [:post] OmniAuth.config.logger = Rails.logger