Skip to content

Commit

Permalink
Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronnie5562 committed Aug 2, 2024
1 parent f284802 commit 851abea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docnet_backend/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def finalize_response(self, request, response, *args, **kwargs):
httponly=True,
samesite=settings.SIMPLE_JWT.get(
"AUTH_COOKIE_SAMESITE", 'Lax'),
domain=settings.SIMPLE_JWT.get("AUTH_COOKIE_DOMAIN", None),
# domain=settings.SIMPLE_JWT.get("AUTH_COOKIE_DOMAIN", None),
secure=settings.SIMPLE_JWT.get("AUTH_COOKIE_SECURE", True),
)

Expand All @@ -128,7 +128,7 @@ def finalize_response(self, request, response, *args, **kwargs):
httponly=True,
samesite=settings.SIMPLE_JWT.get(
"AUTH_COOKIE_SAMESITE", 'Lax'),
domain=settings.SIMPLE_JWT.get("AUTH_COOKIE_DOMAIN", None),
# domain=settings.SIMPLE_JWT.get("AUTH_COOKIE_DOMAIN", None),
secure=settings.SIMPLE_JWT.get("AUTH_COOKIE_SECURE", True),
)
del response.data["access"]
Expand Down
11 changes: 6 additions & 5 deletions docnet_backend/docnet_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
]

CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_ALL_ORIGINS = True

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=30),
Expand All @@ -215,8 +216,8 @@
'AUTH_COOKIE': 'access',
'REFRESH_TOKEN_NAME': 'refresh',
'ACCESS_TOKEN_NAME': 'access',
'AUTH_COOKIE_DOMAIN': 'docnet-test.onrender.com',
'AUTH_COOKIE_SECURE': True,
# 'AUTH_COOKIE_DOMAIN': 'docnet-test.onrender.com',
'AUTH_COOKIE_SECURE': False,
'AUTH_COOKIE_HTTP_ONLY': True,
'AUTH_COOKIE_SAMESITE': 'Lax',
}
Expand All @@ -225,7 +226,7 @@
SESSION_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SAMESITE = 'Lax'

SECURE_SSL_REDIRECT = True
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = False
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
SECURE_REFERRER_POLICY = 'no-referrer-when-downgrade'

0 comments on commit 851abea

Please sign in to comment.