add comment for functionality explanation

This commit is contained in:
seaznCode 2025-12-01 21:15:41 +01:00
parent 7b6735be0e
commit 6831b92169

View File

@ -1,3 +1,9 @@
/**
* Next.js middleware to protect admin routes.
* - Runs for paths matched by the config `matcher` (see bottom).
* - Checks for the `refreshToken` cookie; if missing, redirects to `/login` before any page renders.
* - No manual import/use neededNext.js automatically executes this for matching requests.
*/
import { NextRequest, NextResponse } from 'next/server'
// Move accessToken to HttpOnly cookie in future for better security