I am using next-auth getSession in API routes like this
const mySession = await getSession({ req });
I am certain that the type of the mySession is this
type SessionType = {
user: {
email: string;
};
};
When I mouseover on mySession it displays like this
const mySession: Session | null
This can be either null or type of Session.
How do I override the type with the type SessionType
I tried this
const mySession = await getSession<SessionType>({ req });
This gives me an error
Expected 0 type arguments, but got 1.
How do I change the type of the getSession method?