1
0
Fork 0
mirror of synced 2024-07-15 03:05:57 +12:00

Merge pull request #8774 from Budibase/account-portal-core-fixes

Account portal <-> backend-core fixes
This commit is contained in:
Rory Powell 2022-11-23 08:32:16 +00:00 committed by GitHub
commit 275f596d5c
5 changed files with 17 additions and 3 deletions

View file

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

View file

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

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 "./locks"
export * from "./db" export * from "./db"
export * from "./middleware" export * from "./middleware"
export * from "./featureFlag"

View file

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