M: Improve token handling messages

This commit is contained in:
Ivan 2025-11-06 15:07:48 +03:00
parent 5827d3a0a8
commit ef9d8f31ec

View File

@ -27,6 +27,11 @@ axiosInstance.interceptors.request.use(config => {
.split('; ')
.find(row => row.startsWith('csrftoken='))
?.split('=')[1];
if (!token && config.method !== 'get') {
console.warn('CSRF token not found for non-GET request');
}
if (token) {
config.headers['x-csrftoken'] = token;
}