mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
Updating axios to always send credentials
This commit is contained in:
@@ -6,8 +6,11 @@ const headers = {
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
|
||||
// Create Axios such that we always send credential cookies along with the
|
||||
// request. This allows the Backend services to authenticate the user.
|
||||
const api = axios.create({
|
||||
headers,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const get = (url: string) => api.get(url).then((res) => res.data);
|
||||
|
||||
Reference in New Issue
Block a user