fixed csrf token didn't work in admin panel
This commit is contained in:
parent
9b402ef0ac
commit
61eba79770
@ -3,7 +3,7 @@ axios.defaults.withCredentials = true;
|
|||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
var crypto = window.crypto || window.msCrypto;
|
var crypto = window.crypto || window.msCrypto;
|
||||||
let csrfToken = btoa(String(crypto.getRandomValues(new Uint32Array(1))[0]));
|
let csrfToken = btoa(String(crypto.getRandomValues(new Uint32Array(1))[0]));
|
||||||
document.cookie = `${axios.defaults.xsrfCookieName}=${csrfToken}`;
|
document.cookie = `${axios.defaults.xsrfCookieName}=${csrfToken}; max-age=10; path=/`;
|
||||||
return config;
|
return config;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user