Skip to content

Commit 04ce7e9

Browse files
authored
fix(authentication): Omit query in JWT strategy (#2011)
1 parent ebd8987 commit 04ce7e9

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/authentication/src/jwt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class JWTStrategy extends AuthenticationBaseStrategy {
9494
throw new NotAuthenticated(`Could not find entity service`);
9595
}
9696

97-
const result = await entityService.get(id, omit(params, 'provider'));
97+
const result = await entityService.get(id, omit(params, 'provider', 'query'));
9898

9999
if (!params.provider) {
100100
return result;

packages/authentication/test/jwt.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ describe('authentication/jwt', () => {
7575
app.setup();
7676
});
7777

78-
it('getEntity', async () => {
78+
it('getEntity (and params.query)', async () => {
7979
const [ strategy ] = app.service('authentication').getStrategies('jwt') as JWTStrategy[];
8080

81-
let entity = await strategy.getEntity(user.id, {});
81+
let entity = await strategy.getEntity(user.id, {
82+
query: {
83+
name: 'Dave'
84+
}
85+
});
8286

8387
assert.deepStrictEqual(entity, user);
8488

0 commit comments

Comments
 (0)