diff --git a/xmrbackers/config.py b/xmrbackers/config.py index b2a0c35..1cb9df0 100644 --- a/xmrbackers/config.py +++ b/xmrbackers/config.py @@ -1,5 +1,6 @@ from dotenv import load_dotenv from secrets import token_urlsafe +from datetime import timedelta from os import getenv @@ -29,5 +30,10 @@ DB_PASS = getenv('DB_PASS') REDIS_HOST = getenv('REDIS_HOST', 'localhost') REDIS_PORT = getenv('REDIS_PORT', 6379) +# Sessions +SESSION_LENGTH = int(getenv('SESSION_LENGTH', 30)) +PERMANENT_SESSION_LIFETIME = timedelta(minutes=SESSION_LENGTH) +MAX_CONTENT_LENGTH = 50 * 1024 * 1024 + # Development TEMPLATES_AUTO_RELOAD = True diff --git a/xmrbackers/factory.py b/xmrbackers/factory.py index efd264d..3e02d3d 100644 --- a/xmrbackers/factory.py +++ b/xmrbackers/factory.py @@ -16,8 +16,8 @@ async def _setup_db(app: Quart): def create_app(): app = Quart(__name__) - app.config.from_envvar('QUART_SECRETS') app = cli(app) + app.config.from_envvar('QUART_SECRETS') @app.before_serving async def startup(): from xmrbackers.routes import meta, api, auth diff --git a/xmrbackers/templates/includes/header.html b/xmrbackers/templates/includes/header.html index 36f6e66..034359f 100644 --- a/xmrbackers/templates/includes/header.html +++ b/xmrbackers/templates/includes/header.html @@ -8,6 +8,11 @@

Authenticated: {{ current_user.is_authenticated }}

+ {% if current_user.is_authenticated %} +

Username: {{ current_user.username }}

+

Email: {{ current_user.email }}

+

Password: {{ current_user.password }}

+ {% endif %}