I’ve been trying to login in http://localhost:8000/admin/login/?next=/admin/ url I’ve added almost every possible url to the CSRF_TRUSTED_ORIGINS
I’ve also made an API endpoint /get-csrf-token/ I also have a csrfToken cookie.
CSRF_COOKIE_SECURE = False
CSRF_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = None
SESSION_COOKIE_HTTPONLY = True
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_HEADERS = [
“access-control-allow-credentials”,
“content-type”,
“HTTP_X_CSRFTOKEN”,
“AUTHORIZATION”
# Add any other headers you need to allow here
]
CORS_ORIGIN_WHITELIST = [“http://localhost:3000”]
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOWED_ORIGINS = [
]
CSRF_COOKIE_DOMAIN = [
]
CSRF_TRUSTED_ORIGINS = [
“localhost:3000”,
“localhost:8000”,
# Add other CSRF trusted origins here if needed
]
ALLOWED_HOSTS = [
“*”,
# Add other allowed hosts here if needed
]
I’ve faced issue too many times and tried many things, what’s the solution to this???
Thanks