I'm trying to change the ctx.session.userId to ctx.session.id. After changing this, I get the error You must provide publicData.userId when trying to login.
The types.ts looks like this
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>
PublicData: {
id: User["id"]
role: Role
name: User["name"]
email: User["email"]
avatar: User["avatar"]
}
}
}
but I can see that the parent PublicData (node_modules/next/dist/shared/lib/utils.d.ts) looks like this;
export declare type PublicData = Session extends {
PublicData: unknown;
} ? Session['PublicData'] : {
userId: unknown;
};
Any ideas how I can fix this and use id instead of userId for my session?
Thanks!