dev: fix session token save on admin and remove session save every request

This commit is contained in:
pablohashescobar 2024-05-16 11:58:15 +05:30
parent 92c5ccef3d
commit 715ad1320c
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Django imports
from django.contrib.auth import login
from django.conf import settings
# Module imports
from plane.authentication.utils.host import base_host
@ -7,6 +8,11 @@ from plane.authentication.utils.host import base_host
def user_login(request, user, is_app=False, is_admin=False, is_space=False):
login(request=request, user=user)
# If is admin cookie set the custom age
if is_admin:
request.session.set_expiry(settings.ADMIN_SESSION_COOKIE_AGE)
device_info = {
"user_agent": request.META.get("HTTP_USER_AGENT", ""),
"ip_address": request.META.get("REMOTE_ADDR", ""),

View File

@ -331,7 +331,6 @@ SESSION_ENGINE = "plane.db.models.session"
SESSION_COOKIE_AGE = 604800
SESSION_COOKIE_NAME = "plane-session-id"
SESSION_COOKIE_DOMAIN = os.environ.get("COOKIE_DOMAIN", None)
SESSION_SAVE_EVERY_REQUEST = True
# Admin Cookie
ADMIN_SESSION_COOKIE_NAME = "plane-admin-session-id"