File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ export async function authenticatedUser(
7
7
res : Response ,
8
8
next : NextFunction ,
9
9
) {
10
- const session = res . locals . session ?? ( await getSession ( req , authConfig ) )
10
+ const session =
11
+ res . locals . session ?? ( await getSession ( req , authConfig ) ) ?? undefined
11
12
12
13
res . locals . session = session
13
14
@@ -23,7 +24,7 @@ export async function currentSession(
23
24
res : Response ,
24
25
next : NextFunction ,
25
26
) {
26
- const session = await getSession ( req , authConfig )
27
+ const session = ( await getSession ( req , authConfig ) ) ?? undefined
27
28
res . locals . session = session
28
29
return next ( )
29
30
}
Original file line number Diff line number Diff line change 9
9
"outDir" : " dist" ,
10
10
"baseUrl" : " ." ,
11
11
"skipLibCheck" : true ,
12
- "strict" : true
12
+ "strict" : true ,
13
+ "typeRoots" : [" types/" , " node_modules/@types" ]
13
14
},
14
15
"include" : [" src/**/*.ts" ],
15
16
"exclude" : [" node_modules" ]
Original file line number Diff line number Diff line change
1
+ import { type Session } from "@auth/express"
2
+
3
+ declare module "express" {
4
+ interface Response {
5
+ locals : {
6
+ session ?: Session
7
+ }
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments