Account portal <-> backend-core fixes

This commit is contained in:
Rory Powell 2022-11-22 22:24:45 +00:00
parent 319428cbde
commit 6f3f858d81
5 changed files with 17 additions and 3 deletions

View File

@ -89,6 +89,7 @@ export async function createASession(
userId,
}
await client.store(key, session, EXPIRY_SECONDS)
return session
}
export async function updateSessionTTL(session: Session) {

View File

@ -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 {

View File

@ -0,0 +1,7 @@
export enum FeatureFlag {
LICENSING = "LICENSING",
}
export interface TenantFeatureFlags {
[key: string]: FeatureFlag[]
}

View File

@ -10,3 +10,4 @@ export * from "./auth"
export * from "./locks"
export * from "./db"
export * from "./middleware"
export * from "./featureFlag"

View File

@ -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 {