Skip to content

Commit

Permalink
feature : 사용자 로그인 제한
Browse files Browse the repository at this point in the history
  • Loading branch information
dntjd1097 committed Sep 25, 2023
1 parent d7abebb commit e907007
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion apps/admin(deprecated)/src/pages/Members/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import { AdminContainer, AdminContainerInner } from '@pages/styled';
import { useGetMemberListData } from '@src/apis/hooks/useGetMemberListData';
import { useModalHandle } from '@src/hooks/useModalHandle';
import { IUserDataType } from '@type/userDataType';
import { useGetMyData } from '@src/apis/hooks/useGetMyData';

const Members = () => {
const { memberListData } = useGetMemberListData();
const { openModal, closeModal } = useModalHandle('MEMBER');
const { userData } = useGetMyData();
const [selectMember, setSelectMember] = React.useState<IUserDataType | null>(
null,
);
Expand Down Expand Up @@ -54,7 +56,12 @@ const Members = () => {
<MemberCardWrapper
key={member.userId}
onClick={() => {
openModal(member.userId);
if (
userData?.role !== 'MEMBER' &&
userData?.role !== 'GUEST'
) {
openModal(member.userId);
}
setSelectMember(member);
}}
>
Expand Down
6 changes: 5 additions & 1 deletion apps/admin(deprecated)/src/pages/Redirect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const Redirect = () => {
useEffect(() => {
if (!token) return;
if (!(userData && userData.role)) return;
if (userData.role === 'LEAD' || userData.role === 'CORE') {
if (
userData.role === 'LEAD' ||
userData.role === 'CORE' ||
userData.role === 'MEMBER'
) {
navigate('/certified');
} else {
navigate('/');
Expand Down

0 comments on commit e907007

Please sign in to comment.