Update login

Removed not needed parameters for task status
This commit is contained in:
Ozzie Isaacs 2023-04-03 20:00:13 +02:00
parent b9c942befc
commit 13c0d30a8f
3 changed files with 8 additions and 8 deletions

View File

@ -28,10 +28,10 @@ from flask_login.signals import user_loaded_from_cookie
class MyLoginManager(LoginManager):
def _session_protection_failed(self):
_session = session._get_current_object()
sess = session._get_current_object()
ident = self._session_identifier_generator()
if(_session and not (len(_session) == 1
and _session.get('csrf_token', None))) and ident != _session.get('_id', None):
if(sess and not (len(sess) == 1
and sess.get('csrf_token', None))) and ident != sess.get('_id', None):
return super(). _session_protection_failed()
return False

View File

@ -101,10 +101,12 @@ def admin_required(f):
@admi.before_app_request
def before_request():
if not ub.check_user_session(current_user.id, flask_session.get('_id')) and 'opds' not in request.path:
if not ub.check_user_session(current_user.id,
flask_session.get('_id')) and 'opds' not in request.path \
and config.config_session == 1:
logout_user()
g.constants = constants
g.google_site_verification = os.getenv('GOOGLE_SITE_VERIFICATION','')
g.google_site_verification = os.getenv('GOOGLE_SITE_VERIFICATION', '')
g.allow_registration = config.config_public_reg
g.allow_anonymous = config.config_anonbrowse
g.allow_upload = config.config_uploading

View File

@ -43,9 +43,7 @@ def get_email_status_json():
@login_required
def get_tasks_status():
# if current user admin, show all email, otherwise only own emails
tasks = WorkerThread.get_instance().tasks
answer = render_task_status(tasks)
return render_title_template('tasks.html', entries=answer, title=_("Tasks"), page="tasks")
return render_title_template('tasks.html', title=_("Tasks"), page="tasks")
# helper function to apply localize status information in tasklist entries