Skip to content
Snippets Groups Projects
Commit cb2913b9 authored by Leonardo Christino's avatar Leonardo Christino Committed by Scott
Browse files

fix(dev): fix dev authentication pathway

parent fcce6ff0
No related branches found
No related tags found
No related merge requests found
...@@ -63,15 +63,17 @@ export const useAuth = () => { ...@@ -63,15 +63,17 @@ export const useAuth = () => {
const fetchAuthenticated = (input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> => { const fetchAuthenticated = (input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> => {
if (!init) init = fetchSettings; if (!init) init = fetchSettings;
init.credentials = 'include'; if (!import.meta.env.SKIP_LOGIN) {
init.redirect = 'follow'; init.credentials = 'include';
init.method = init.method || 'GET'; init.redirect = 'follow';
init.headers = { init.method = init.method || 'GET';
'Content-Type': 'application/json', init.headers = {
sessionid: auth.sessionID || '', 'Content-Type': 'application/json',
// Authorization: `Bearer ${auth.jwt}`, sessionid: auth.sessionID || '',
...init.headers, // Authorization: `Bearer ${auth.jwt}`,
}; ...init.headers,
};
}
return fetch(input, init); return fetch(input, init);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment