Add logging info in case sign in fails (#1519)

* Add logging info in case sign in fails

* Use string interpolation instead

* Remove logger from auth service
This commit is contained in:
Andy Zhao 2019-01-14 10:01:17 -05:00 committed by Ben Halpern
parent 12d31853de
commit e3f9792b21

View file

@ -24,9 +24,15 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
else
session["devise.#{provider}_data"] = request.env["omniauth.auth"]
user_errors = @user.errors.full_messages
logger.error "Log in error: sign in failed. username: #{@user.username} - email: #{@user.email}"
logger.error "Log in error: auth data hash - #{request.env['omniauth.auth']}"
logger.error "Log in error: user_errors: #{user_errors}"
flash[:alert] = user_errors
redirect_to new_user_registration_url
end
rescue StandardError => error
logger.error "Log in error: #{error}"
logger.error "Log in error: auth data hash - #{request.env['omniauth.auth']}"
end
def persisted_and_valid?