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