This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you are using Next 14 Make sure to plece this in Src folder. | |
# To learn more about middelware https://nextjs.org/docs/app/building-your-application/routing/middleware | |
import { NextResponse } from "next/server"; | |
import type { NextRequest } from "next/server"; | |
export async function middleware(request: NextRequest) { | |
const isLoggedin = () => { | |
// Mark isLoggedin as async | |
const authToken = request.cookies.get("authtokenlogIn"); | |
if (authToken?.value == "1") { |