Skip to content

Commit 2b258fd

Browse files
jalbersdorferdaffl
authored andcommitted
fix: LocalStrategy authenticates without username (#1560)
#1559
1 parent eae036b commit 2b258fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/authentication-local/src/strategy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export class LocalStrategy extends AuthenticationBaseStrategy {
4545

4646
async findEntity (username: string, params: Params) {
4747
const { entityUsernameField, service, errorMessage } = this.configuration;
48+
if (!username) { // don't query for users without any condition set.
49+
throw new NotAuthenticated(errorMessage);
50+
}
51+
4852
const query = await this.getEntityQuery({
4953
[entityUsernameField]: username
5054
}, params);

0 commit comments

Comments
 (0)