Account portal <-> backend-core fixes
This commit is contained in:
parent
319428cbde
commit
6f3f858d81
|
@ -89,6 +89,7 @@ export async function createASession(
|
|||
userId,
|
||||
}
|
||||
await client.store(key, session, EXPIRY_SECONDS)
|
||||
return session
|
||||
}
|
||||
|
||||
export async function updateSessionTTL(session: Session) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { BBContext } from "./koa"
|
||||
import { Hosting } from "./hosting"
|
||||
|
||||
export interface AuthToken {
|
||||
userId: string
|
||||
|
@ -10,6 +11,7 @@ export interface CreateSession {
|
|||
sessionId: string
|
||||
tenantId: string
|
||||
csrfToken?: string
|
||||
hosting?: Hosting
|
||||
}
|
||||
|
||||
export interface Session extends CreateSession {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
export enum FeatureFlag {
|
||||
LICENSING = "LICENSING",
|
||||
}
|
||||
|
||||
export interface TenantFeatureFlags {
|
||||
[key: string]: FeatureFlag[]
|
||||
}
|
|
@ -10,3 +10,4 @@ export * from "./auth"
|
|||
export * from "./locks"
|
||||
export * from "./db"
|
||||
export * from "./middleware"
|
||||
export * from "./featureFlag"
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
import { Context, Request } from "koa"
|
||||
import { User, Role, UserRoles } from "../documents"
|
||||
import { License } from "../sdk"
|
||||
import { User, Role, UserRoles, Account } from "../documents"
|
||||
import { FeatureFlag, License } from "../sdk"
|
||||
|
||||
export interface ContextUser extends Omit<User, "roles"> {
|
||||
globalId?: string
|
||||
license: License
|
||||
license?: License
|
||||
userId?: string
|
||||
roleId?: string | null
|
||||
role?: Role
|
||||
roles?: UserRoles
|
||||
csrfToken?: string
|
||||
featureFlags?: FeatureFlag[]
|
||||
accountPortalAccess?: boolean
|
||||
account?: Account
|
||||
}
|
||||
|
||||
export interface BBRequest extends Request {
|
||||
|
|
Loading…
Reference in New Issue