2021-07-31 15:57:43 +00:00
|
|
|
import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
2021-07-31 15:57:43 +00:00
|
|
|
import { User, Role } from "./db";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
|
|
|
declare module "blitz" {
|
|
|
|
export interface Ctx extends DefaultCtx {
|
2021-07-31 15:57:43 +00:00
|
|
|
session: SessionContext;
|
2021-07-31 14:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Session {
|
2021-07-31 15:57:43 +00:00
|
|
|
isAuthorized: SimpleRolesIsAuthorized<Role>;
|
2021-07-31 14:33:18 +00:00
|
|
|
PublicData: {
|
2021-07-31 15:57:43 +00:00
|
|
|
userId: User["id"];
|
|
|
|
role: Role;
|
|
|
|
};
|
2021-07-31 14:33:18 +00:00
|
|
|
}
|
|
|
|
}
|