Skip to content

Commit

Permalink
Merge pull request #110 from Bside-Team-Four/fix/108
Browse files Browse the repository at this point in the history
fix: ํ† ํฐ ๋งŒ๋ฃŒ์‹œ ๋กœ๊ทธ์•„์›ƒ
  • Loading branch information
thxtome authored Jan 28, 2024
2 parents 528f219 + 769adba commit cbac137
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/api/ApiService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getSession } from 'next-auth/react';
import { getSession, signOut } from 'next-auth/react';

import axios, { AxiosError, AxiosResponse } from 'axios';

Expand Down Expand Up @@ -30,6 +30,10 @@ function interceptorResponseFulfilled(res: AxiosResponse) {
}

function interceptorResponseRejected(error: AxiosError<ApiErrorScheme>) {
if (error.response?.status === 401) {
signOut();
}

if (error.response?.data?.message) {
return Promise.reject(new ApiException(error.response.data, error.response.status));
}
Expand Down

1 comment on commit cbac137

@vercel
Copy link

@vercel vercel bot commented on cbac137 Jan 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

popo-client โ€“ ./

popo-client.vercel.app
popo-client-popo.vercel.app
popo-client-git-main-popo.vercel.app

Please sign in to comment.