mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-11-15 17:21:38 +03:00
M: Improve token handling messages
This commit is contained in:
parent
5827d3a0a8
commit
ef9d8f31ec
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user