Skip to content

Commit ab74229

Browse files
committed
Expose user id from accounts module
1 parent 5bd2d69 commit ab74229

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

module/src/auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ interface Subscription {
299299
};
300300

301301
interface BaseAccountData {
302+
userId?: string;
302303
email?: string;
303304
subscription?: Subscription;
304305
banned: boolean;
@@ -444,6 +445,7 @@ function parseUserData(appData: UserAppData | null): User {
444445
if (!appData) return anonUser();
445446

446447
return {
448+
userId: appData.user_id,
447449
email: appData.email,
448450
subscription: parseSubscriptionData(appData),
449451
teamSubscription: appData.team_subscription

module/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface SubscriptionPricing {
3636

3737
// User app data, as returned by the API
3838
export type UserAppData = {
39+
user_id: string;
3940
email: string;
4041
feature_flags?: string[];
4142
banned?: boolean;
@@ -49,6 +50,7 @@ export type UserAppData = {
4950

5051
// User billing data, as returned by the API
5152
export type UserBillingData = {
53+
user_id: string;
5254
email: string;
5355
banned?: boolean;
5456
transactions: TransactionData[] | null;

0 commit comments

Comments
 (0)