DRF always return not authenticated in Django rest framework fed on NextJS and Axios

After testing on postman i get the right response but when i pushed the code for the frontend guys, I get a report that it's always returning false...

views.py

# Check authentication status
def check(request):
    data = {}
    if request.user.is_authenticated:
        data['response'] = 'user is authenticated'
        data['name'] = request.user.name
        data['email'] = request.user.email
        data['phone_number'] = request.user.phone_number
        data['id_user'] = request.user.id_user
        data['passed_kyc'] = request.user.passed_kyc
    else:
        data['response'] = 'user is not authenticated'
    return JsonResponse(data)

It probably depends on what value they expect from the response, so ask them to show you the code or to tell you what key/value pair they expect from the response, and what values they expect to mean "true" or "false"

For example, if they expect a key "isAuthenticated" and a value of either "true/false", then you should be adding:

data['isAuthenticated'] = True/False #depending on whether user is authenticated or not
Back to Top