Skip to content

Commit

Permalink
fix(authentication): Omit query in JWT strategy (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored Jul 12, 2020
1 parent ebd8987 commit 04ce7e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/authentication/src/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class JWTStrategy extends AuthenticationBaseStrategy {
throw new NotAuthenticated(`Could not find entity service`);
}

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

if (!params.provider) {
return result;
Expand Down
8 changes: 6 additions & 2 deletions packages/authentication/test/jwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ describe('authentication/jwt', () => {
app.setup();
});

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

let entity = await strategy.getEntity(user.id, {});
let entity = await strategy.getEntity(user.id, {
query: {
name: 'Dave'
}
});

assert.deepStrictEqual(entity, user);

Expand Down

0 comments on commit 04ce7e9

Please sign in to comment.