Permalink
Browse files

Merge pull request #1197 from p53/1192-misleading-audit-log-message

Make audit log more verbose
  • Loading branch information...
fredreichbier committed Feb 6, 2019
2 parents 7209787 + f5aaa98 commit cdbd2b7c8ae067d8b9277c05f9d1be7488c68fde
Showing with 11 additions and 1 deletion.
  1. +11 −1 privacyidea/api/before_after.py
@@ -247,7 +247,17 @@ def after_request(response):
@postrequest(sign_response, request=request)
def auth_error(error):
if "audit_object" in g:
g.audit_object.log({"info": error.message})
message = ''

if hasattr(error, 'message'):
message = error.message

if hasattr(error, 'details'):
if error.details:
if 'message' in error.details:
message = u'{}|{}'.format(message, error.details['message'])

g.audit_object.log({"info": message})
g.audit_object.finalize_log()
return send_error(error.message,
error_code=error.id,

0 comments on commit cdbd2b7

Please sign in to comment.