GRN2-224: Added event logs and production caching (#739)

* Added event logs and production caching

* Added Support: before logs for easy identification

* Added more Support for log errors

* Reverted change to assets precompile check

* Added vendor assets to precompile list

* Travis fix
This commit is contained in:
farhatahmad
2019-08-14 14:25:52 -04:00
committed by Jesus Federico
parent f87c2bfd16
commit 89f36c1766
10 changed files with 41 additions and 12 deletions

View File

@ -31,6 +31,8 @@ class SessionsController < ApplicationController
# POST /users/login
def create
logger.info("Support: #{session_params[:email]} is attempting to login.")
admin = User.find_by(email: session_params[:email])
if admin&.has_role? :super_admin
user = admin
@ -118,6 +120,8 @@ class SessionsController < ApplicationController
user = User.from_omniauth(@auth)
logger.info("Support: Auth user #{user.email} is attempting to login.")
# Add pending role if approval method and is a new user
if approval_registration && !@user_exists
user.add_role :pending
@ -143,7 +147,7 @@ class SessionsController < ApplicationController
end
end
rescue => e
logger.error "Error authenticating via omniauth: #{e}"
logger.error "Support: Error authenticating via omniauth: #{e}"
omniauth_fail
end
end