8000 fix(authentication): Omit query in JWT strategy by daffl · Pull Request #2011 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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