1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

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 {