shellphone.app/types.ts
2021-08-01 22:03:05 +08:00

19 lines
386 B
TypeScript

import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz";
import { User, Role } from "./db";
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext;
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>;
PublicData: {
userId: User["id"];
role: Role;
hasCompletedOnboarding?: true;
};
}
}