Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Felioh committed May 5, 2024
1 parent f528863 commit 295408b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/interceptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ async function refreshToken(url) {
instance
.post('/auth/refresh', {}, { headers: { Cookie: cookies } })
.then((response) => {
console.log('Refresh response status:', response.status);
if (response.status !== 201) {
throw new Error(`Failed to refresh token ${error}`);
}
saveCookies(response, url, (error) => {
if (error) {
console.log(response.headers);
Expand All @@ -57,9 +59,7 @@ async function refreshToken(url) {
});
})
.catch((error) => {
if (response.status !== 201) {
throw new Error(`Failed to refresh token ${error}`);
}
console.error('Failed to refresh token', error);
});
}

Expand Down

0 comments on commit 295408b

Please sign in to comment.