Forums

ajax request from SPA

I have a single page react app hosted in the static file server that makes ajax requests to a django app hosted on pythonanywhere.

When the password option is enabled every ajax request requires that I enter credentials with a pop up (chrome) or simply failing silently with 401 (firefox)

Is there a way of including the credentials in an ajax request?

http://garthbeetle.pythonanywhere.com/ojclient/ and watch the network tab when you're clicking on seats or staff or project to see the ajax.

thank you

You probably don't want to send credentials, just the auth cookie for your app. You should check the docs of whatever JS ajax library you're using to determine how to send authentication info.