diff --git a/packages/client/src/api/patches.ts b/packages/client/src/api/patches.ts index 8f09eb5442..9482644fa7 100644 --- a/packages/client/src/api/patches.ts +++ b/packages/client/src/api/patches.ts @@ -55,7 +55,7 @@ export const patchAPI = (API: APIClient) => { const fetchSelf = API.fetchSelf API.fetchSelf = async () => { const user = await fetchSelf() - if (user && user._id) { + if (user && "_id" in user && user._id) { if (user.roleId === "PUBLIC") { // Don't try to enrich a public user as it will 403 return user diff --git a/packages/frontend-core/src/api/self.ts b/packages/frontend-core/src/api/self.ts index db5b1226eb..0f4ff1f985 100644 --- a/packages/frontend-core/src/api/self.ts +++ b/packages/frontend-core/src/api/self.ts @@ -13,7 +13,7 @@ export interface SelfEndpoints { generateAPIKey: () => Promise fetchDeveloperInfo: () => Promise fetchBuilderSelf: () => Promise - fetchSelf: () => Promise + fetchSelf: () => Promise } export const buildSelfEndpoints = (API: BaseAPIClient): SelfEndpoints => ({