UsersService: Wait for the DB to find a user

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-10-17 21:52:59 +02:00
parent 16b5f3a5c8
commit 6e6ab84391
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -29,7 +29,7 @@ export class UsersService {
} }
async getUserByUsername(userName: string): Promise<User> { async getUserByUsername(userName: string): Promise<User> {
const user = this.userRepository.findOne({ const user = await this.userRepository.findOne({
where: { userName: userName }, where: { userName: userName },
}); });
if (user === undefined) { if (user === undefined) {