File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import { default as nextAuth } from "next-auth/middleware" ;
22import createMiddleware from "next-intl/middleware" ;
3- import { chain , FinalNextResponse } from "@nimpl/middleware-chain" ;
3+ import { chain } from "@nimpl/middleware-chain" ;
4+ import { NextResponse } from "next/server" ;
45
56const intlMiddleware = createMiddleware ( {
67 locales : [ "en" , "dk" ] ,
@@ -9,8 +10,10 @@ const intlMiddleware = createMiddleware({
910
1011export default chain ( [
1112 [ intlMiddleware , { exclude : / ^ \/ p r i v a t e ( \/ .* ) ? $ / } ] ,
12- ( req ) => {
13- if ( req . summary . type === "redirect" ) return FinalNextResponse . next ( ) ;
13+ ( ) => {
14+ const next = new NextResponse ( ) ;
15+ next . cookies . set ( "custom-cookie" , Date . now ( ) . toString ( ) ) ;
16+ return next ;
1417 } ,
1518 [ nextAuth , { include : / ^ \/ p r i v a t e ( \/ .* ) ? $ / } ] ,
1619] ) ;
You can’t perform that action at this time.
0 commit comments