diff --git a/webapp/titanembeds/app.py b/webapp/titanembeds/app.py index 17b59f3..6b3a43f 100644 --- a/webapp/titanembeds/app.py +++ b/webapp/titanembeds/app.py @@ -8,6 +8,7 @@ import os from titanembeds.database import get_administrators_list from titanembeds.i18n import LANGUAGES import titanembeds.constants as constants +from datetime import timedelta try: import uwsgi @@ -29,6 +30,7 @@ app.config['RATELIMIT_HEADERS_ENABLED'] = True app.config['SQLALCHEMY_POOL_RECYCLE'] = 250 app.config['SQLALCHEMY_POOL_SIZE'] = 100 app.config['RATELIMIT_STORAGE_URL'] = 'keyvalprops://' +app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=3) app.secret_key = config['app-secret'] db.init_app(app) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index ab577d8..ab4d209 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -315,6 +315,7 @@ def create_unauthenticated_user(): session['user_keys'] = {guild_id: key} else: session['user_keys'][guild_id] = key + session.permanent = False status = update_user_status(guild_id, username, key) return jsonify(status=status) else: diff --git a/webapp/titanembeds/blueprints/user/user.py b/webapp/titanembeds/blueprints/user/user.py index 60959d5..37b18d6 100644 --- a/webapp/titanembeds/blueprints/user/user.py +++ b/webapp/titanembeds/blueprints/user/user.py @@ -39,6 +39,7 @@ def callback(): return redirect(url_for('user.logout')) session['user_keys'] = discord_token session['unauthenticated'] = False + session.permanent = True user = get_current_authenticated_user() session['user_id'] = user['id'] session['username'] = user['username']