Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit c2a3189

Browse files
committed
add max age
1 parent c289bda commit c2a3189

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codecov_auth/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
import logging
23
from datetime import timedelta
34
from typing import Optional, Sequence
@@ -92,11 +93,13 @@ def impersonate_owner(self, request, queryset):
9293

9394
# this cookie is read by the `ImpersonationMiddleware` and
9495
# will reset `request.current_owner` to the impersonated owner
96+
max_age = datetime.timedelta(minutes=3)
9597
response.set_cookie(
9698
"staff_user",
9799
owner.ownerid,
98100
domain=settings.COOKIES_DOMAIN,
99101
samesite=settings.COOKIE_SAME_SITE,
102+
max_age=max_age,
100103
)
101104
History.log(
102105
Owner.objects.get(ownerid=owner.ownerid),

0 commit comments

Comments
 (0)