Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/suitable

This commit is contained in:
Daseul Kim 2025-05-22 18:16:56 +09:00
commit b2c22dc5a5
2 changed files with 7 additions and 1 deletions

View File

@ -22,5 +22,5 @@ export async function middleware(request: NextRequest) {
// 2. /admin/* (exclude all routes under /admin)
// 3. /_next/* (exclude Next.js static and image assets)
export const config = {
matcher: ['/((?!dashboard|login|admin|api|_next/static|_next/image|favicon.ico).*)'],
matcher: ['/((?!login|assets).*)', '/((?!_next/static|_next/image|favicon.ico).*)'],
}

View File

@ -74,6 +74,12 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
router.push('/')
}
}
if (pathname === '/') {
if (!session?.isLoggedIn) {
router.push('/login')
}
}
//alert 함수 변경해서 바인딩
window.alert = function (msg, alertBtn = () => setAlert(false)) {
alertFunc(msg, alertBtn)