feat(WEB-132): add middlewares, support for seamless login and improve lang based routes

This commit is contained in:
Michael Zetterberg
2024-04-08 16:08:35 +02:00
parent 8ab5325fc3
commit 7093a0b2dd
31 changed files with 493 additions and 188 deletions

9
types/auth.d.ts vendored
View File

@@ -1,5 +1,4 @@
import "next-auth"
import type { NextRequest } from "next/server"
// Module augmentation
// https://authjs.dev/getting-started/typescript#popular-interfaces-to-augment
@@ -22,14 +21,6 @@ declare module "next-auth" {
* Returned by `useSession`, `auth`, contains information about the active session.
*/
interface Session {}
/**
* NextAuthRequest isn't exported by next-auth so we declare a copy
* of how they do it to support or switch in middleware.ts
*/
interface NextAuthRequest extends NextRequest {
auth: Session | null
}
}
declare module "next-auth/jwt" {