Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions foundations/core/packages/account-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,14 @@ export interface AccountClient {
getWorkspacePermissions: (params: { accountId: AccountUuid, permission: string }) => Promise<WorkspaceUuid[]>
getWorkspaceUsersWithPermission: (params: { permission: string }) => Promise<AccountUuid[]>

verify2fa: (code: string) => Promise<LoginInfo>

setCookie: () => Promise<void>
deleteCookie: () => Promise<void>

generate2faSecret: () => Promise<{ secret: string, url: string }>
enable2fa: (secret: string, code: string) => Promise<void>
disable2fa: (code: string) => Promise<void>
}

/** @public */
Expand Down Expand Up @@ -1335,6 +1341,42 @@ class AccountClientImpl implements AccountClient {
params
})
}

async verify2fa (code: string): Promise<LoginInfo> {
const request = {
method: 'verify2fa' as const,
params: { code }
}

return await this.rpc(request)
}

async generate2faSecret (): Promise<{ secret: string, url: string }> {
const request = {
method: 'generate2faSecret' as const,
params: {}
}

return await this.rpc(request)
}

async enable2fa (secret: string, code: string): Promise<void> {
const request = {
method: 'enable2fa' as const,
params: { secret, code }
}

await this.rpc(request)
}

async disable2fa (code: string): Promise<void> {
const request = {
method: 'disable2fa' as const,
params: { code }
}

await this.rpc(request)
}
}

function withRetry<T, F extends (...args: any[]) => Promise<T>> (
Expand Down
Loading
Loading