Merge pull request #79 from TeamBNBN/FE/router

[Front-End] feat: Fe/router 인증 관련 추가
This commit is contained in:
Jo Hyeonsoo 2024-07-22 13:49:28 +09:00 committed by GitHub
commit a7f4e6251b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 6 deletions

View File

@ -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 />,
},
],
},
]);

View File

@ -32,7 +32,7 @@ export default function Header() {
<Link to={'/'}>마이페이지</Link>
</li>
<li>
<Link to={'/'}>로그인</Link>
<Link to={'/login'}>로그인</Link>
</li>
</ul>
</nav>

View File

@ -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}`}
>
비밀번호를 잊으셨나요?

View File

@ -22,7 +22,7 @@ export default function UserRegisterPage() {
const linkProps = {
message: '이미 회원이신가요?',
path: '/',
path: '../login',
title: '로그인',
};