forked from shaba/openuds
Merge remote-tracking branch 'origin/v3.5'
This commit is contained in:
commit
b0255a980c
@ -34,6 +34,7 @@ import typing
|
|||||||
|
|
||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from sympy import EX
|
||||||
|
|
||||||
from uds.core.util import os_detector as OsDetector
|
from uds.core.util import os_detector as OsDetector
|
||||||
from uds.core.util.config import GlobalConfig
|
from uds.core.util.config import GlobalConfig
|
||||||
@ -80,9 +81,12 @@ class GlobalRequestMiddleware:
|
|||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
expiry = request.session.get(EXPIRY_KEY, now)
|
expiry = request.session.get(EXPIRY_KEY, now)
|
||||||
if expiry < now:
|
if expiry < now:
|
||||||
webLogout(
|
try:
|
||||||
request=request
|
webLogout(
|
||||||
) # Ignore the response, just processes usere session logout
|
request=request
|
||||||
|
) # Ignore the response, just processes usere session logout
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
return HttpResponse(content='Session Expired', status=403)
|
return HttpResponse(content='Session Expired', status=403)
|
||||||
# Update session timeout..self.
|
# Update session timeout..self.
|
||||||
request.session[EXPIRY_KEY] = now + datetime.timedelta(
|
request.session[EXPIRY_KEY] = now + datetime.timedelta(
|
||||||
|
Loading…
Reference in New Issue
Block a user