MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / resolveActiveAccountId

Function resolveActiveAccountId

apps/api/src/api/auth/auth.utils.ts:22–33  ·  view source on GitHub ↗
(
  userId: string
)

Source from the content-addressed store, hash-verified

20 * (signup always creates a personal account).
21 */
22export const resolveActiveAccountId = async (
23 userId: string
24): Promise<string> => {
25 const memberships = await accountsService.getMembershipsForUser(userId);
26 const first = memberships[0];
27
28 if (first === undefined) {
29 throw ApiErrors.internal(`User ${userId} has no active memberships`);
30 }
31
32 return first.accountId;
33};

Callers 2

mfa.routes.tsFile · 0.90
auth.routes.tsFile · 0.90

Calls 1

getMembershipsForUserMethod · 0.80

Tested by

no test coverage detected