Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

Can we inject property at NextRequest in Next.js

$
0
0
import { DefaultSession } from "next-auth";declare module "next-auth" {  interface Session {    user: {      id: string;    } & DefaultSession["user"];  }}

Like this code, we inject the user object inside next-auth while using this while accessing session.user.idTypeScript does not complain about type.I am using app router and next version is "next": "14.0.4"


Viewing all articles
Browse latest Browse all 11661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>