feat: Add availableTeams to auth.info endpoint (#3981)
* Index emails migration * feat: Add available teams to auth.info endpoint * test * separate presenter * Include data from sessions cookie, include likely logged in state * test * test: Add test for team only in session cookie * Suggested query change in PR feedback
This commit is contained in:
11
server/presenters/availableTeam.ts
Normal file
11
server/presenters/availableTeam.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Team } from "@server/models";
|
||||
|
||||
export default function present(team: Team, isSignedIn = false) {
|
||||
return {
|
||||
id: team.id,
|
||||
name: team.name,
|
||||
avatarUrl: team.logoUrl,
|
||||
url: team.url,
|
||||
isSignedIn,
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import presentApiKey from "./apiKey";
|
||||
import presentAuthenticationProvider from "./authenticationProvider";
|
||||
import presentAvailableTeam from "./availableTeam";
|
||||
import presentCollection from "./collection";
|
||||
import presentCollectionGroupMembership from "./collectionGroupMembership";
|
||||
import presentDocument from "./document";
|
||||
@@ -26,28 +27,29 @@ import presentWebhookSubscription from "./webhookSubscription";
|
||||
|
||||
export {
|
||||
presentApiKey,
|
||||
presentFileOperation,
|
||||
presentAuthenticationProvider,
|
||||
presentUser,
|
||||
presentView,
|
||||
presentAvailableTeam,
|
||||
presentCollection,
|
||||
presentCollectionGroupMembership,
|
||||
presentDocument,
|
||||
presentEvent,
|
||||
presentRevision,
|
||||
presentCollection,
|
||||
presentShare,
|
||||
presentSearchQuery,
|
||||
presentStar,
|
||||
presentSubscription,
|
||||
presentTeam,
|
||||
presentFileOperation,
|
||||
presentGroup,
|
||||
presentGroupMembership,
|
||||
presentIntegration,
|
||||
presentMembership,
|
||||
presentNotificationSetting,
|
||||
presentSlackAttachment,
|
||||
presentPin,
|
||||
presentPolicies,
|
||||
presentGroupMembership,
|
||||
presentCollectionGroupMembership,
|
||||
presentRevision,
|
||||
presentSearchQuery,
|
||||
presentShare,
|
||||
presentSlackAttachment,
|
||||
presentStar,
|
||||
presentSubscription,
|
||||
presentTeam,
|
||||
presentUser,
|
||||
presentView,
|
||||
presentWebhook,
|
||||
presentWebhookSubscription,
|
||||
};
|
||||
|
||||
@@ -16,6 +16,6 @@ export default function present(team: Team) {
|
||||
url: team.url,
|
||||
defaultUserRole: team.defaultUserRole,
|
||||
inviteRequired: team.inviteRequired,
|
||||
allowedDomains: team.allowedDomains.map((d) => d.name),
|
||||
allowedDomains: team.allowedDomains?.map((d) => d.name),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user