Merge pull request #79 from TeamBNBN/FE/router
[Front-End] feat: Fe/router 인증 관련 추가
This commit is contained in:
commit
a7f4e6251b
@ -14,6 +14,9 @@ const QuestionListPage = lazy(async () => await import('./pages/QuestionListPage
|
||||
const QuestionDetailPage = lazy(async () => await import('./pages/QuestionDetailPage'));
|
||||
const CreateQuestionPage = lazy(async () => await import('./pages/CreateQuestionPage'));
|
||||
const NoticeWritePage = lazy(async () => await import('./pages/NoticeWritePage/NoticeWritePage'));
|
||||
const LoginPage = lazy(async () => await import('./pages/LoginPage'));
|
||||
const UserRegisterPage = lazy(async () => await import('./pages/UserRegisterPage'));
|
||||
const PasswordResetPage = lazy(async () => await import('./pages/PasswordResetPage'));
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
@ -73,6 +76,18 @@ const router = createBrowserRouter([
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
element: <LoginPage />,
|
||||
},
|
||||
{
|
||||
path: 'register',
|
||||
element: <UserRegisterPage />,
|
||||
},
|
||||
{
|
||||
path: 'password-reset',
|
||||
element: <PasswordResetPage />,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
@ -32,7 +32,7 @@ export default function Header() {
|
||||
<Link to={'/'}>마이페이지</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={'/'}>로그인</Link>
|
||||
<Link to={'/login'}>로그인</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -9,12 +9,10 @@ export default function LoginPage() {
|
||||
// linkProps : 버튼 아래 나오는 링크(회원가입 등)에 대한 props object
|
||||
const linkProps = {
|
||||
message: '아직 회원이 아니신가요?',
|
||||
path: '/',
|
||||
path: '../register',
|
||||
title: '회원가입',
|
||||
};
|
||||
|
||||
const findPasswordPath = '/';
|
||||
|
||||
const handleSubmit = () => {
|
||||
// TODO: 로그인 POST 기능 추가
|
||||
console.log('로그인', idRef.current.value, passwordRef.current.value);
|
||||
@ -40,7 +38,7 @@ export default function LoginPage() {
|
||||
ref={passwordRef}
|
||||
>
|
||||
<Link
|
||||
to={findPasswordPath}
|
||||
to={'../password-reset'}
|
||||
className={`${styles.textBodyStrong} ${styles.secondaryColor}`}
|
||||
>
|
||||
비밀번호를 잊으셨나요?
|
||||
|
@ -22,7 +22,7 @@ export default function UserRegisterPage() {
|
||||
|
||||
const linkProps = {
|
||||
message: '이미 회원이신가요?',
|
||||
path: '/',
|
||||
path: '../login',
|
||||
title: '로그인',
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user