Skip to content

Commit

Permalink
fix: LocalStrategy authenticates without username (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalbersdorfer authored and daffl committed Sep 16, 2019
1 parent eae036b commit 2b258fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/authentication-local/src/strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export class LocalStrategy extends AuthenticationBaseStrategy {

async findEntity (username: string, params: Params) {
const { entityUsernameField, service, errorMessage } = this.configuration;
if (!username) { // don't query for users without any condition set.
throw new NotAuthenticated(errorMessage);
}

const query = await this.getEntityQuery({
[entityUsernameField]: username
}, params);
Expand Down

0 comments on commit 2b258fd

Please sign in to comment.