Skip to content
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
4 changes: 1 addition & 3 deletions src/components/auth/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import SubmitButton from '@/components/auth/SubmitButton';
import { LOGIN_FORM_PLACEHOLDER } from '@/constants/auth';
import { loginSchema, LoginFormData } from '@/apis/auth/types';
import { login } from '@/apis/auth';
import { useRouter } from 'next/navigation';
import useAlert from '@/hooks/useAlert';

export default function LoginForm() {
Expand All @@ -24,7 +23,6 @@ export default function LoginForm() {
},
});

const router = useRouter();
const alert = useAlert();

const onSubmit = async (loginFormData: LoginFormData) => {
Expand All @@ -33,7 +31,7 @@ export default function LoginForm() {
alert(response.message);
} else {
await alert('로그인이 완료되었습니다!');
router.replace('/mydashboard');
window.location.reload();
}
};

Expand Down
4 changes: 1 addition & 3 deletions src/components/dashboard-header/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { useEffect, useRef, useState } from 'react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { useQueryClient } from '@tanstack/react-query';
import { motion } from 'motion/react';
import { useGetUser } from '@/apis/users/queries';
Expand All @@ -14,15 +13,14 @@ export default function Profile() {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const { data, isFetching } = useGetUser();
const alert = useAlert();
const router = useRouter();
const menuRef = useRef<HTMLDivElement | null>(null);
const queryClient = useQueryClient();

const handleLogout = async () => {
await axiosClientHelper.post('/auth/logout');
await alert('로그아웃 했습니다.');
queryClient.invalidateQueries();
router.replace('/');
window.location.reload();
};

useEffect(() => {
Expand Down
10 changes: 1 addition & 9 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,5 @@ export const middleware = async (request: NextRequest) => {
};

export const config = {
matcher: [
{
source: '/:path*',
missing: [
{ type: 'header', key: 'next-router-prefetch' },
{ type: 'header', key: 'purpose', value: 'prefetch' },
],
},
],
matcher: ['/:path*'],
};