Reconciliar fontes instaladas 423bd512d8c5 com main
This commit is contained in:
@@ -113,6 +113,10 @@ export async function portalRequest<T>(
|
||||
): Promise<T> {
|
||||
const headers = new Headers(options.headers);
|
||||
headers.set('Accept', 'application/json');
|
||||
if (options.method && !['GET', 'HEAD'].includes(options.method.toUpperCase())) {
|
||||
const token = document.cookie.split('; ').find(value => value.startsWith('XSRF-TOKEN='))?.slice(11);
|
||||
if (token) headers.set('X-XSRF-TOKEN', decodeURIComponent(token));
|
||||
}
|
||||
const response = await fetch(url, {
|
||||
...options,
|
||||
credentials: 'same-origin',
|
||||
|
||||
Reference in New Issue
Block a user