Skip to content

Commit

Permalink
fix[#391] : 로그인 안된 상태로 마이 페이지 접근시 에러 페이지로 리다이렉트
Browse files Browse the repository at this point in the history
- 로그인 안된 상태로 마이 페이지 접근시 에러 페이지로 리다이렉트
  • Loading branch information
gintooooonic committed Dec 5, 2021
1 parent 1fa25eb commit 928b79d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/src/page/mypage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import React from 'react';
import React, { useEffect } from 'react';
import { css } from '@emotion/react';
import Profile from './component/Profile';
import MyList from './component/MyList';
import footprintImg from '../../asset/footprint.png';
import useLoginUser from '../../hook/useLoginUser';
import { useHistory } from 'react-router';

export default function MyPage() {
useLoginUser();
const history = useHistory();
const loginUser = useLoginUser();
useEffect(() => {
if (!loginUser.isSigned) history.replace('/error');
}, []);

return (
<div css={MyPageStyle}>
Expand Down

0 comments on commit 928b79d

Please sign in to comment.