Skip to content
Snippets Groups Projects
Commit 18377ade authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Set cookie SameSite policy to Lax and skip the HttpOnly flag to allow the...

Set cookie SameSite policy to Lax and skip the HttpOnly flag to allow the cookies to be used by the frontend
parent 3034f6f5
No related branches found
No related tags found
1 merge request!159Set cookie SameSite policy to Lax and skip the HttpOnly flag to allow the...
Pipeline #100599 passed
...@@ -78,15 +78,10 @@ AUTHENTICATION_BACKENDS = [ ...@@ -78,15 +78,10 @@ AUTHENTICATION_BACKENDS = [
SESAME_MAX_AGE = 600 # lifetime of token in seconds SESAME_MAX_AGE = 600 # lifetime of token in seconds
SESSION_COOKIE_AGE = 1800 # lifetime of session in seconds SESSION_COOKIE_AGE = 1800 # lifetime of session in seconds
CSRF_COOKIE_SAMESITE = "Lax"
CSRF_COOKIE_SAMESITE = "Strict" SESSION_COOKIE_SAMESITE = "Lax"
SESSION_COOKIE_SAMESITE = "Strict" CSRF_COOKIE_HTTPONLY = False
# CSRF_COOKIE_HTTPONLY = True SESSION_COOKIE_HTTPONLY = False
# SESSION_COOKIE_HTTPONLY = True
# Enable these in production
# CSRF_COOKIE_SECURE = True
# SESSION_COOKIE_SECURE = True
REST_FRAMEWORK = { REST_FRAMEWORK = {
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning",
......
...@@ -44,13 +44,6 @@ AUTHENTICATION_BACKENDS = [ ...@@ -44,13 +44,6 @@ AUTHENTICATION_BACKENDS = [
LOGIN_REDIRECT_URL = "http://localhost:3000/" LOGIN_REDIRECT_URL = "http://localhost:3000/"
LOGOUT_REDIRECT_URL = "http://localhost:3000/" LOGOUT_REDIRECT_URL = "http://localhost:3000/"
CSRF_COOKIE_SAMESITE = "Strict"
SESSION_COOKIE_SAMESITE = "Lax"
# CSRF_COOKIE_HTTPONLY = True
# SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_AGE = 1209600 # two weeks for easy development
LOGGING = { LOGGING = {
"version": 1, "version": 1,
"disable_existing_loggers": False, "disable_existing_loggers": False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment