mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-27 15:54:16 +00:00
Created a new model to represent the Flask-Session storage schema sessions
with a method for removing expired sessions.
Added a trigger for the Flask-Session model's session clean-up method to the `before_request` handler of the user router.
This commit is contained in:
@@ -37,6 +37,11 @@ def before_request():
|
||||
minutes=int(Setting().get('session_timeout')))
|
||||
session.modified = True
|
||||
|
||||
# Clean up expired sessions in the database
|
||||
if Setting().get('session_type') == 'sqlalchemy':
|
||||
from ..models.sessions import Sessions
|
||||
Sessions().clean_up_expired_sessions()
|
||||
|
||||
|
||||
@user_bp.route('/profile', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
|
Reference in New Issue
Block a user