We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ba077c1 + 4d21402 commit e745797Copy full SHA for e745797
frontend/src/api/client.ts
@@ -26,6 +26,11 @@ export const api = axios.create({
26
withCredentials: true,
27
});
28
29
+const existingToken = typeof window !== "undefined" ? window.localStorage.getItem('token') : undefined;
30
+if (existingToken) {
31
+ setAuthToken(existingToken);
32
+}
33
+
34
api.interceptors.response.use(
35
(response) => {
36
// Securely update the token on each response
0 commit comments