Index: frontend/src/api/axiosInstance.ts
===================================================================
--- frontend/src/api/axiosInstance.ts	(revision 0c86e77a055e354a71be0ff7c053051ca180993b)
+++ frontend/src/api/axiosInstance.ts	(revision 484dc3f54a72450588e7ece748ea1b64ad9ffdc3)
@@ -5,8 +5,13 @@
 export const axiosInstance = axios.create({
 	baseURL,
-	headers: {
-		"Content-Type": "application/json",
-	},
 	withCredentials: true,
+});
+
+// set content-type to application/json unless sending FormData
+axiosInstance.interceptors.request.use((config) => {
+	if (!(config.data instanceof FormData)) {
+		config.headers["Content-Type"] = "application/json";
+	}
+	return config;
 });
 
@@ -23,4 +28,8 @@
 export const scheduleTokenRefresh = (expiryTimeSeconds: number) => {
 	clearRefreshTimeout();
+
+	if (!expiryTimeSeconds || expiryTimeSeconds <= 0) {
+		return;
+	}
 
 	const refreshTime = (expiryTimeSeconds - 60) * 1000;
@@ -44,4 +53,5 @@
 			scheduleTokenRefresh(refreshResponse.data.tokenExpiresIn);
 		} catch (err) {
+			clearRefreshTimeout();
 			console.error(err);
 			throw err;
@@ -53,5 +63,5 @@
 };
 
-axios.interceptors.response.use(
+axiosInstance.interceptors.response.use(
 	(response) => response,
 	async (error) => {
