Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] /minder URL경로 접속 시 로그인으로 리다이렉트되는 문제 해결 #301

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/api/axios.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

reissue하는 부분이 StompContext 에도 있어서 해당 부분까지 작업 부탁드립니다~!

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
Loading