Skip to content

Commit

Permalink
locust_final
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonju977 committed Sep 8, 2024
1 parent 4c51f49 commit 64feab8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions api/users/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import os
from dataclasses import dataclass, field

from pathlib import Path

import pytz
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import timezone

from dotenv import load_dotenv
from rest_framework.permissions import BasePermission
from rest_framework_simplejwt.tokens import RefreshToken

BASE_DIR = Path(__file__).resolve().parent.parent


@dataclass
Expand Down Expand Up @@ -108,9 +109,10 @@ def set_cookie_attributes(response, key, token):
key=key,
value=token,
httponly=True,
samesite="Lax",
secure=False,
samesite="None",
secure=True,
expires=expires_at,
domain=os.getenv("COOKIE_DOMAIN"),
path="/",
)

Expand Down Expand Up @@ -201,14 +203,14 @@ def set_cookie_attributes(response, key, token):
else:
raise ValueError("key should be 'access' or 'refresh'")


response.set_cookie(
key=key,
value=token,
httponly=True,
samesite="Lax",
secure=False,
samesite="None",
secure=True,
expires=expires_at,
domain=os.getenv("COOKIE_DOMAIN"),
path="/",
)
return response
Expand Down

0 comments on commit 64feab8

Please sign in to comment.