Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Add some more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Jun 13, 2019
1 parent ff5d272 commit 27f71d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions project_amber/handlers/auth.py
Expand Up @@ -6,6 +6,7 @@
from project_amber.errors import BadRequest
from project_amber.helpers.auth import handleChecks, removeSession, \
createSession
from project_amber.logging import log

def login():
"""
Expand Down Expand Up @@ -37,4 +38,5 @@ def logout():
"""
user = handleChecks()
removeSession(user.token, user.id)
log("User %s logged out" % user.name)
return EMPTY_RESP
5 changes: 5 additions & 0 deletions project_amber/handlers/session.py
Expand Up @@ -7,6 +7,7 @@
from project_amber.errors import Forbidden
from project_amber.helpers.auth import handleChecks, getSessions, getSession,\
removeSessionById
from project_amber.logging import log

def handle_session_req():
"""
Expand Down Expand Up @@ -70,4 +71,8 @@ def handle_session_id_req(session_id: int):
if (time() - user.login_time) < MATURE_SESSION:
raise Forbidden(MSG_IMMATURE_SESSION)
removeSessionById(session_id, user.id)
log("User {0} deleted session {1}".format(
user.name,
session_id
))
return EMPTY_RESP

0 comments on commit 27f71d5

Please sign in to comment.