From ab74229e1be1ad61c8930ecd0645c2387726aa45 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 11 Nov 2024 15:34:29 +0100 Subject: [PATCH] Expose user id from accounts module --- module/src/auth.ts | 2 ++ module/src/types.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/module/src/auth.ts b/module/src/auth.ts index 1e4e37d..e186dad 100644 --- a/module/src/auth.ts +++ b/module/src/auth.ts @@ -299,6 +299,7 @@ interface Subscription { }; interface BaseAccountData { + userId?: string; email?: string; subscription?: Subscription; banned: boolean; @@ -444,6 +445,7 @@ function parseUserData(appData: UserAppData | null): User { if (!appData) return anonUser(); return { + userId: appData.user_id, email: appData.email, subscription: parseSubscriptionData(appData), teamSubscription: appData.team_subscription diff --git a/module/src/types.ts b/module/src/types.ts index 173ad5a..32737c1 100644 --- a/module/src/types.ts +++ b/module/src/types.ts @@ -36,6 +36,7 @@ export interface SubscriptionPricing { // User app data, as returned by the API export type UserAppData = { + user_id: string; email: string; feature_flags?: string[]; banned?: boolean; @@ -49,6 +50,7 @@ export type UserAppData = { // User billing data, as returned by the API export type UserBillingData = { + user_id: string; email: string; banned?: boolean; transactions: TransactionData[] | null;