Skip to content

Commit 1b095c4

Browse files
committed
Increase Request Timeout From Frontend To Backend
This fixes the response of quiz grades from failing Signed-off-by: Tal Jacob <taljacob2@gmail.com>
1 parent a05dc7d commit 1b095c4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

nextstep-frontend/src/serverApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {getUserAuth, removeUserAuth, setUserAuth} from "./handlers/userAuth.ts";
77
// Create an Axios instance
88
const api: AxiosInstance = axios.create({
99
baseURL: config.app.backend_url(),
10+
timeout: 15 * 60 * 1000,
1011
});
1112

1213
// Function to refresh the token
@@ -15,7 +16,7 @@ const refreshToken = async (): Promise<LoginResponse | null> => {
1516
const authData = getUserAuth();
1617
const response = await axios.post(`${config.app.backend_url()}/auth/refresh`, {
1718
refreshToken: authData.refreshToken,
18-
});
19+
}, { timeout: 15 * 60 * 1000 });
1920
const newAuthData = response.data as LoginResponse;
2021
setUserAuth(newAuthData);
2122
return newAuthData;

0 commit comments

Comments
 (0)