Skip to content

Commit

Permalink
fix(api-security-cognito): apply admin user plugins to "admin" identi…
Browse files Browse the repository at this point in the history
…ty only
  • Loading branch information
Pavel910 committed Jun 11, 2024
1 parent 96f2f69 commit ce7781a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api-security-cognito/src/createCognito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const createCognito = <
});

const { getIdentity, getPermissions } = config;
const isAdminIdentity = config.identityType === "admin";

return [
new ContextPlugin<TContext>(context => {
Expand Down Expand Up @@ -95,7 +96,6 @@ export const createCognito = <
const teams = context.wcp.canUseTeams();
context.plugins.register(adminUsersGqlPlugins({ teams }));
}),
installGqlPlugins,
createAdminUsersHooks()
isAdminIdentity ? [installGqlPlugins, createAdminUsersHooks()] : []
];
};

0 comments on commit ce7781a

Please sign in to comment.