Skip to content

Commit

Permalink
Merge branch 'dev' into feat/open_consult_share_294
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdnps10 authored Jun 15, 2024
2 parents b6edd86 + 4129197 commit 26f242a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ instance.interceptors.response.use(

if (tokenResponse.status === 200) {
const { accessToken, refreshToken } = tokenResponse.data;

setCookie('accessToken', accessToken);
setCookie('refreshToken', refreshToken);
setCookie('accessToken', accessToken, { path: '/' });
setCookie('refreshToken', refreshToken, { path: '/' });
axios.defaults.headers.common.Authorization = `${accessToken}`;
originRequest.headers.Authorization = `${accessToken}`;
return instance(originRequest);
Expand Down Expand Up @@ -97,9 +96,8 @@ publicInstance.interceptors.response.use(
});
if (tokenResponse.status === 200) {
const { accessToken, refreshToken } = tokenResponse.data;

setCookie('accessToken', accessToken);
setCookie('refreshToken', refreshToken);
setCookie('accessToken', accessToken, { path: '/' });
setCookie('refreshToken', refreshToken, { path: '/' });
axios.defaults.headers.common.Authorization = `${accessToken}`;
originRequest.headers.Authorization = `${accessToken}`;
return axios(originRequest);
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/StompContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export const StompProvider: React.FC<{ children: ReactNode }> = ({
});
if (tokenResponse.status === 200) {
const { accessToken, refreshToken } = tokenResponse.data;
setCookie('accessToken', accessToken);
setCookie('refreshToken', refreshToken);
setCookie('accessToken', accessToken, { path: '/' });
setCookie('refreshToken', refreshToken, { path: '/' });
connectChat();
}
} catch (error) {
Expand Down

0 comments on commit 26f242a

Please sign in to comment.