Skip to content

Commit

Permalink
fix: 없어진 경로인 '/login'으로 리다이렉트 되는 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
phnml1 committed Jan 24, 2025
1 parent 910a075 commit 97b6252
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/(afterLogin)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function RootLayout({
}>) {
const token = cookies().get('accessToken');
if (!token) {
redirect('/login');
redirect('/');
}
const queryClient = new QueryClient();
await queryClient.prefetchInfiniteQuery({
Expand Down
2 changes: 1 addition & 1 deletion src/app/(beforeLogin)/redirected/kakao/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Login() {
},
onError: (error) => {
console.error('Login Failed', error);
router.push('/login');
router.push('/');
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type PathToTitleMap = {
export const pathToTitleMap:PathToTitleMap = {
'/group/register': '모임 등록',
'/group/history': '그룹 참여 정보',
'/login': '로그인',
// '/login': '로그인',
'/ranking': '랭킹',
'/message': '채팅',
}
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isTokenExpired } from '@/lib/isTokenExpired';
import { NextRequest, NextResponse } from 'next/server';

function gotoLogin(request: NextRequest) {
const response = NextResponse.redirect(new URL('/login', request.url));
const response = NextResponse.redirect(new URL('/', request.url));
response.cookies.delete('accessToken');
response.cookies.delete('refresh-token');
return response;
Expand Down

0 comments on commit 97b6252

Please sign in to comment.