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
2 changes: 1 addition & 1 deletion src/app/mobile/main/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function MobileMain() {
{showPopUp && (
<PopUp
title="🚨 공지사항 안내 🚨"
content={`2025년 1학기 복지물품 대여는\n6월 2일(월)부로 종료됩니다.\n
content={`2026년 1학기 복지물품 대여는\n3월 9일(월)부터 가능합니다.\n
이용에 참고 부탁드립니다!`}
onClickCta={() => setShowPopUp(false)}
onClickOther={() => {
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/useAuthRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useEffect } from 'react';
import { useRouter, usePathname } from 'next/navigation';
import Cookies from 'js-cookie';

const adminRole = ['ADMIN', 'GA', 'WORKER'];

const useAuthRedirect = () => {
const router = useRouter();
const pathname = usePathname();
Expand Down Expand Up @@ -39,7 +41,10 @@ const useAuthRedirect = () => {
return;
}

if (currentPage.startsWith('/mobile/admin') && user.role !== 'ADMIN') {
if (
currentPage.startsWith('/mobile/admin') &&
adminRole.includes(user.role)
) {
alert('관리자만 이용 가능한 페이지입니다.');
router.replace('/mobile/main');
}
Expand Down