I use Oscar API in my project. It uses httponly cookies to log in and register and other options like add to basket.
All I need is to use it with react/next js project. But I can't access cookies because of httponly cookies. So please help me with oscar API authentication.
In my react js code I already use
withcredentials true
when fetching from API.
in the Django setting I already use
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = True
SESSION_COOKIE_SAMESITE = None
CRSF_COOKIE_SAMESITE = None
I made a mistake
SESSION_COOKIE_SAMESITEneeds to pass a string data but I send None, all I need I send it as a string.must use them when working with HTTP-only cookies with the Django rest framework.
in react js/ next js just use
withcredentials truewhile fetch api.