Skip to content

Commit

Permalink
Expose user id from accounts module
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Nov 11, 2024
1 parent 5bd2d69 commit ab74229
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ interface Subscription {
};

interface BaseAccountData {
userId?: string;
email?: string;
subscription?: Subscription;
banned: boolean;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions module/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit ab74229

Please sign in to comment.