Skip to content

Commit

Permalink
Merge pull request #301 from sharemindteam/fix/minder_login_297
Browse files Browse the repository at this point in the history
[Bug] /minder URL경로 접속 시 로그인으로 리다이렉트되는 문제 해결
  • Loading branch information
kyuhho authored Jun 15, 2024
2 parents 401de36 + a6d8172 commit 4129197
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,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 @@ -86,8 +86,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 4129197

Please sign in to comment.