Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# User Agent
user_agent = Column(Text)
+
+ # Logout!
+
+ async def logout(self):
+ """
+ Destroys this session
+ """
+ await self.db.delete(self)
@base.authenticated
async def get(self):
# Destroy the user's session.
- async with self.db.transaction():
+ async with await self.db.transaction():
+ # Fetch the session
+ session = await self.get_session()
+
# Destroy the session
- await self.session.destroy()
+ if session:
+ session.logout()
# Remove the session cookie
self.clear_cookie("session_id")