Skip to content

Commit

Permalink
[Common] [Hotfix] 회원 탈퇴 토큰 삭제 로직 추가, 리다이렉션 콘솔 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
suwonthugger committed Nov 10, 2024
1 parent 479ca3a commit 11ed3ae
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions apps/mobile/src/app/user/[userId]/main-setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const MainSetting = () => {
const handleDelAuth = () => {
회원탈퇴함수(undefined, {
onSuccess: () => {
localStorage.removeItem('accessToken');
window.location.href = '/';
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/shared/apis/user/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const usePutSchool = () => {
certificateCode,
}),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['userInfo'] });
queryClient.invalidateQueries({ queryKey: ['user', 'userSchool'] });
},
onError: () => {
alert('학교 변경에 실패했습니다.');
Expand All @@ -129,7 +129,7 @@ export const usePutRegion = () => {
mutationFn: (modifyRegionName: string) => putRegion(modifyRegionName),
onSuccess: () => {
alert('지역이 변경되었습니다.');
queryClient.invalidateQueries({ queryKey: ['userInfo'] });
queryClient.invalidateQueries({ queryKey: ['user', 'userRegion'] });
},
onError: () => {
alert('지역 변경에 실패했습니다.');
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/shared/apis/user/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const usePutSchool = () => {
certificateCode,
}),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['userInfo'] });
queryClient.invalidateQueries({ queryKey: ['user', 'userSchool'] });
},
onError: () => {
alert('학교 변경에 실패했습니다.');
Expand All @@ -129,7 +129,7 @@ export const usePutRegion = () => {
mutationFn: (modifyRegionName: string) => putRegion(modifyRegionName),
onSuccess: () => {
alert('지역이 변경되었습니다.');
queryClient.invalidateQueries({ queryKey: ['userInfo'] });
queryClient.invalidateQueries({ queryKey: ['user', 'userRegion'] });
},
onError: () => {
alert('지역 변경에 실패했습니다.');
Expand Down
5 changes: 0 additions & 5 deletions apps/web/src/shared/components/layout/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ const Header = () => {
);
};

console.log(navigator.userAgent, isMobile(), window.location.hostname);
console.log(
`https://m.rankit.run${window.location.pathname}${window.location.search}`,
);

if (isMobile() && window.location.hostname === 'www.rankit.run') {
const newUrl = `https://m.rankit.run${window.location.pathname}${window.location.search}`;
window.location.replace(newUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function ModalContentMainSetting() {
const handleDelAuth = () => {
회원탈퇴함수(undefined, {
onSuccess: () => {
localStorage.removeItem('accessToken');
window.location.href = '/';
},
});
Expand Down

0 comments on commit 11ed3ae

Please sign in to comment.