|
|
@ -64,7 +64,7 @@ export const http = axios.create({ |
|
|
withCredentials: true, |
|
|
withCredentials: true, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
http.interceptors.request.use(async (config) => { |
|
|
|
|
|
|
|
|
http.interceptors.request.use((config) => { |
|
|
if (shouldUseProxy() && config.url && !isAbsoluteUrl(config.url)) { |
|
|
if (shouldUseProxy() && config.url && !isAbsoluteUrl(config.url)) { |
|
|
config.params = withProxyPathParam(config.params, config.url); |
|
|
config.params = withProxyPathParam(config.params, config.url); |
|
|
config.url = ""; |
|
|
config.url = ""; |
|
|
@ -84,10 +84,8 @@ http.interceptors.request.use(async (config) => { |
|
|
config.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"; |
|
|
config.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"; |
|
|
config.headers["Pragma"] = "no-cache"; |
|
|
config.headers["Pragma"] = "no-cache"; |
|
|
|
|
|
|
|
|
// Wait for a pending Flutter token injection rather than firing the request
|
|
|
|
|
|
// unauthenticated (or, as before, with a hardcoded test token).
|
|
|
|
|
|
const token = |
|
|
const token = |
|
|
(await authBridge.waitForToken()) ?? |
|
|
|
|
|
|
|
|
authBridge.getToken() ?? |
|
|
getClientCookie("HABIB_TOKEN") ?? |
|
|
getClientCookie("HABIB_TOKEN") ?? |
|
|
getClientCookie("habib_token"); |
|
|
getClientCookie("habib_token"); |
|
|
|
|
|
|
|
|
|