-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtypes.ts
More file actions
27 lines (23 loc) · 679 Bytes
/
types.ts
File metadata and controls
27 lines (23 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz"
import { User } from "db"
// Note: You should switch to Postgres and then use a DB enum for role type
export type Role = "ADMIN" | "USER"
export type Connectors = "injected" | "walletconnect"
export type Actions = "connected" | "disconnected"
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>
PublicData: {
userId: User["id"]
role: Role
}
}
}
export interface PrivateSession {
walletAddress: string
connector: Connectors
lastAction: Actions
}