Automatic audit logging using SQLA events
This commit is contained in:
@@ -5,6 +5,8 @@ import pendulum
|
||||
from atst.domain.requests import Requests
|
||||
from atst.domain.users import Users
|
||||
from atst.domain.authnid import AuthenticationContext
|
||||
from atst.domain.audit_log import AuditLog
|
||||
from atst.domain.auth import logout as _logout
|
||||
|
||||
|
||||
bp = Blueprint("atst", __name__)
|
||||
@@ -79,7 +81,11 @@ def login_redirect():
|
||||
|
||||
@bp.route("/logout")
|
||||
def logout():
|
||||
if session.get("user_id"):
|
||||
del (session["user_id"])
|
||||
|
||||
_logout()
|
||||
return redirect(url_for(".home"))
|
||||
|
||||
|
||||
@bp.route("/activity-history")
|
||||
def activity_history():
|
||||
audit_events = AuditLog.get_all_events(g.current_user)
|
||||
return render_template("audit_log.html", audit_events=audit_events)
|
||||
|
Reference in New Issue
Block a user