This commit is contained in:
Matilda Landström
2024-05-14 15:23:21 +02:00
parent a43754d624
commit 74ff37008d
3 changed files with 5 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ import type { MiddlewareMatcher } from "@/types/middleware"
export const middleware = auth(async (request) => {
const { nextUrl } = request
const lang = findLang(nextUrl.pathname)!
console.log("TestTest ", nextUrl)
const isLoggedIn = !!request.auth
const hasError = request.auth?.error

View File

@@ -1,8 +1,9 @@
import { NextResponse, type NextMiddleware } from "next/server"
import { type NextMiddleware, NextResponse } from "next/server"
import { findLang } from "@/constants/languages"
import { env } from "@/env/server"
import { badRequest, internalServerError } from "@/server/errors/next"
import { decryptData } from "@/utils/aes"
import type { MiddlewareMatcher } from "@/types/middleware"