Skip to content

Commit ce7781a

Browse files
committed
fix(api-security-cognito): apply admin user plugins to "admin" identity only
1 parent 96f2f69 commit ce7781a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/api-security-cognito/src/createCognito.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const createCognito = <
4949
});
5050

5151
const { getIdentity, getPermissions } = config;
52+
const isAdminIdentity = config.identityType === "admin";
5253

5354
return [
5455
new ContextPlugin<TContext>(context => {
@@ -95,7 +96,6 @@ export const createCognito = <
9596
const teams = context.wcp.canUseTeams();
9697
context.plugins.register(adminUsersGqlPlugins({ teams }));
9798
}),
98-
installGqlPlugins,
99-
createAdminUsersHooks()
99+
isAdminIdentity ? [installGqlPlugins, createAdminUsersHooks()] : []
100100
];
101101
};

0 commit comments

Comments
 (0)