diff --git a/app/modules/roxywi/auth.py b/app/modules/roxywi/auth.py index 04a68e79..c34519c1 100644 --- a/app/modules/roxywi/auth.py +++ b/app/modules/roxywi/auth.py @@ -12,11 +12,6 @@ def check_login(user_uuid, token, **kwargs) -> str: if user_uuid is None: return 'login_page' - try: - sql.delete_old_uuid() - except Exception as e: - raise Exception(f'error: cannot connect to DB {e}') - if user_uuid is not None: if sql.get_user_name_by_uuid(user_uuid) is None: return 'login_page' @@ -127,7 +122,7 @@ def do_login(user_uuid: str, user_group: str, user: str, next_url: str): login_user(user) resp = make_response(redirect_to) resp.set_cookie('uuid', user_uuid, secure=True, expires=expires.strftime("%a, %d %b %Y %H:%M:%S GMT"), httponly=True, samesite='Strict') - resp.set_cookie('group', str(user_group), secure=True, expires=expires.strftime("%a, %d %b %Y %H:%M:%S GMT"), httponly=True, samesite='Strict') + resp.set_cookie('group', str(user_group), expires=expires.strftime("%a, %d %b %Y %H:%M:%S GMT"), samesite='Strict') try: user_group_name = sql.get_group_name_by_id(user_group) diff --git a/app/routes/main/routes.py b/app/routes/main/routes.py index a99ac317..9ceaf38b 100644 --- a/app/routes/main/routes.py +++ b/app/routes/main/routes.py @@ -20,6 +20,16 @@ import modules.service.common as service_common import modules.service.haproxy as service_haproxy +@app.errorhandler(404) +def page_not_found(e): + return render_template('404.html'), 404 + + +@app.errorhandler(500) +def page_not_found(e): + return render_template('500.html', e=e), 500 + + @app.before_request def make_session_permanent(): session.permanent = True @@ -31,16 +41,6 @@ def _db_close(exc): conn.close() -@bp.errorhandler(404) -def page_not_found(e): - return render_template('404.html'), 404 - - -@bp.errorhandler(500) -def page_not_found(e): - return render_template('500.html', e=e), 500 - - @bp.route('/stats//', defaults={'serv': None}) @bp.route('/stats//') @login_required @@ -150,11 +150,6 @@ def service_history(service, server_ip): elif service == 'user': history = sql.select_action_history_by_user_id(server_ip) - try: - sql.delete_action_history_for_period() - except Exception as e: - print(e) - return render_template( 'history.html', role=user_params['role'], user=user, users=users, serv=server_ip, service=service, history=history, user_services=user_params['user_services'], token=user_params['token'],